I've set up a simple docker container with Alpine and a tool called bowtie2. When I try to run bowtie2-align-s
, I get this error:
sh: ./bowtie2-align-s: not found
However, ls
tells me that the file is there. I installed bowtie2 from a Linux binary distribution. How would I tell if that distribution is compatible with Alpine Linux? I'm running docker 17.09.0-ce on Ubuntu 16.04.
Here's the full Dockerfile:
FROM alpine:3.6
ENV BOWTIE2_VERSION 2.2.8
RUN apk add --no-cache \
perl \
wget \
openssl \
ca-certificates \
strace \
&& wget https://downloads.sourceforge.net/project/bowtie-bio/bowtie2/$BOWTIE2_VERSION/bowtie2-$BOWTIE2_VERSION-linux-x86_64.zip \
&& unzip -d /usr/local bowtie2-$BOWTIE2_VERSION-linux-x86_64.zip \
&& rm bowtie2-$BOWTIE2_VERSION-linux-x86_64.zip
I test it like this:
$ sudo docker run -it --rm --security-opt seccomp:unconfined bowtie2-bin sh
/ # /usr/local/bowtie2-2.2.8/bowtie2-align-s --version
sh: /usr/local/bowtie2-2.2.8/bowtie2-align-s: not found
/ # ls -l /usr/local/bowtie2-2.2.8/bowtie2-align-s
-rwxr-xr-x 1 root root 11600541 Nov 15 18:49 /usr/local/bowtie2-2.2.8/bowtie2-align-s
/ # strace -v -s 1000 /usr/local/bowtie2-2.2.8/bowtie2-align-s --version
execve("/usr/local/bowtie2-2.2.8/bowtie2-align-s", ["/usr/local/bowtie2-2.2.8/bowtie2-align-s", "--version"], ["HOSTNAME=a72609479c9a", "SHLVL=1", "HOME=/root", "TERM=xterm", "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "BOWTIE2_VERSION=2.2.8", "PWD=/"]) = -1 ENOENT (No such file or directory)
writev(2, [{iov_base="strace: exec: No such file or directory", iov_len=39}, {iov_base="\n", iov_len=1}], 2strace: exec: No such file or directory
) = 40
writev(2, [{iov_base="", iov_len=0}, {iov_base=NULL, iov_len=0}], 2) = 0
getpid() = 11
exit_group(1) = ?
+++ exited with 1 +++
/ #
I run docker with unconfined access to allow strace
to run. You can see that ls
finds the file, but sh
doesn't seem to. strace
doesn't seem to show any other files being accessed, so what is going on?
Thanks to BMitch's comment, I found the answer. I needed the
libc6-compat
package for GNU libc compatibility. Here's the fixed version of the docker file:I also got it working when I built bowtie2 from source, so I think I'll go with that. I'm not sure how reliable the compatibility package is.
If you want all the details, I had to install the
file
package to follow BMitch's suggestion:The interpreter
interpreter /lib64/ld-linux-x86-64.so.2
looked suspicious to me, and Alpine Linux doesn't have a/lib64
folder. A little searching found a related discussion:I tried that, and found that I also needed the
libstdc++
package. Now it works well enough to report the version number.