File missing from docker image? Err: standard_init_linux.go:211: exec user process caused "no such file or directory"


#1

I’m having trouble getting the scrape command to run with docker-compose. Error message:

standard_init_linux.go:211: exec user process caused “no such file or directory”

Any thoughts appreciated!

Setup

I’m running docker for Windows desktop. Just forked and cloned the openstates repo earlier today. I’m working from this fork: https://github.com/kenwrites/openstates

$ docker --version
Docker version 19.03.1, build 74b1e89

$ docker-compose --version
docker-compose version 1.24.1, build 4667896b

Output

$ docker build --tag=openstates
(executes successfully - image appears in docker images)

$ docker-compose run --rm scrape nc --fastmode --scrape
Pulling scrape (openstates/openstates:)…
latest: Pulling from openstates/openstates
e7c96db7181b: Already exists
6c4876b47f75: Pull complete
a45566d42305: Pull complete
Digest: sha256:71ec7f87f3d7808b430aed257700377f3db1227748dd2b0dc4d865cfe71ba774
Status: Downloaded newer image for openstates/openstates:latest
standard_init_linux.go:211: exec user process caused “no such file or directory”

What I’ve tried

I’ve tried deleting and rebuilding the image. Searching for the error message online turns up lots of hits, but none are applicable, as far as I can see. Some refer to dynamic linked libraries, and line-endings, but I didn’t find any that seem to apply here.


#2

OK, found it! While working on Windows 10, git clone automatically changes the line endings of your files to CRLF: https://github.com/docker/labs/issues/215

For Docker images to work correctly, you have to run git config --global core.autocrlf false before cloning the repo or pulling code.