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"Container could not be started on a remote server while on local machine all worked fine.
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
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.
--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.