Search This Blog

Monday, 6 August 2018

Docker issue with "no such file or directory"

Problem


Trying run a docker container fails with mysterious error:
container_linux.go:247: starting container process caused "exec: \"./twit_test\": stat ./twit_test: no such file or directory"
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"./twit_test\": stat ./twit_test: no such file or directory".
ERRO[0000] error getting events from daemon: context canceled
Makefile:18: recipe for target 'run' failed
make: *** [run] Error 127
Container could not be started on a remote server while on local machine all worked fine.

Background


Command:

docker run \
--name=twit-test \
--rm \
-p 5000:7077 \
-v /home/tamara/data:/app \
        -e TWITTER_CONS_KEY=${TWITTER_CONS_KEY} \
-e TWITTER_CONS_SECRET=${TWITTER_CONS_SECRET} \
quay.io/tamarakaufler/twit-test:v1alpha1


Dockerfile is located in ~/programming/go/src/..../go-twit/examples

After some testing and poking around, I located the offending line, which was the volume binding. From what I can see the local volume to be bindmounted (a funny word) must be on the level where the command is run or lower, ie the same directory or its subdirectory. Maybe this is a well known fact but it was not to me. Wiser now.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.