Docker Standard_init_linux.go:207: exec user process caused “no such file or directory”

Nick Roz picture Nick Roz · Apr 30, 2019 · Viewed 7.5k times · Source

My Dockerfile looks like:

FROM ubuntu:18.04

RUN apt-get ...
...
COPY app /bin

And my executable app is just bash script:

make -f /app/makefile $@

When I try to run

docker run -v "`pwd`:/project" -it --rm my_image app

I get the following error:

standard_init_linux.go:207: exec user process caused "exec format error"
make: *** [run] Error 1

What should I do?

Answer

Nick Roz picture Nick Roz · Apr 30, 2019

In case you entrypoint is bash script check whether it contains correct shebang, something like that:

#!/usr/bin/env bash
make -f /app/makefile $@

Either specify it in your entrypoint command, something like:

ENTRYPOINT ["sh", "/bin/app"]