So I've added a file using ADD in the docker file
...
ADD flvcheck /usr/local/bin/flvcheck
It build right and the file is there:
$ docker run --rm=true -ti image ls -l /usr/local/bin/flvcheck
-rwxrwxr-x 1 root root 1659908 May 20 07:56 /usr/local/bin/flvcheck
But When I try to run it I get:
$ docker run --rm=true -ti image /usr/local/bin/flvcheck
2014/05/20 08:43:25 no such file or directory
I did even install strace and use -D=true, but the problem is just that the file is being not found:
execve("/usr/local/bin/flvcheck", ["flvcheck"], [/* 8 vars */]) = -1 ENOENT (No such file or directory)
What is happening here? I can't find the issue (The file works ok in the host system and I can see it's contents within the docker
I've found out that this was because of the architecture. The Container was running a x86_64 image (default debian:squeeze) and the file is in i386.
The red herring was because the file not found, did not referred to the file itself, but the file loader... now that's a useful error message...
To sort this out just install the i386 libraries. For the ubuntu base image adding this to the dockerfile will solve your problem:
For others (even newer ubuntu images), this might get trickier.