Docker Community Forums

Share and learn in the Docker community.

Standard_init_linux.go:175 exec user process caused no such file

I just started using Docker for Windows and I quickly run into an error that I cannot resolve.
I have tried both the stable and beta releases with the same result.

standard_init_linux.go:175: exec user process caused "no such file or directory

This happens on e.g. the mongodb 3.2 Dockerfile on the hub. If I remove the ENTRYPOINT in that Dockerfile it will start.

The issue happens in other dockerfiles as well though. I believe it is related to ENTRYPOINT but I am not 100% certain.

Docker version

Client:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 21:04:48 2016
 OS/Arch:      windows/amd64
 Experimental: true

Server:
 Version:      1.12.0
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   8eab29e
 Built:        Thu Jul 28 21:04:48 2016
 OS/Arch:      linux/amd64
 Experimental: true

Docker info

Containers: 5
 Running: 3
 Paused: 0
 Stopped: 2
Images: 68
Server Version: 1.12.0
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 55
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: seccomp
Kernel Version: 4.4.15-moby
Operating System: Alpine Linux v3.4
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 3.855 GiB
Name: moby
ID: ZSLX:OERW:JGK6:HHAV:AGQU:IHA4:XZYA:2BIH:S2FS:WS5M:ZMK5:5MME
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8`

Just a quick note.

The entrypoint does indeed exist since I’m doing a chmod +x on it.

With the chmod commented out like below I’m getting a “permission denied” error instead of “no such file”.

COPY docker-entrypoint.sh /entrypoint.sh
#RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
1 Like

Finally figured it.

I had to run dos2unix on the entrypoint script. Wish the error message was more descriptive.

18 Likes

Line endings can be a PITA when working with shell scripts on Linux, unfortunately it’s Linux itself that’s producing such an uninformative error.

Running on a Linux machine, and changing a script to DOS line endings;

./script.sh
bash: ./script.sh: /bin/sh^M: bad interpreter: No such file or directory

We’re working on trying to improve that error message (at least to try including which file caused the error)

1 Like

hi can you explain it slowly so I can comprehend your point

Thank you! This worked for me as well after much frustration.

Saved my day… thanks a lot

I think you just have to make sure the line endings of your files, especially (exclusively?) the .sh scripts are unix-style not some other (windows).

2 Likes

Thank you! For me was about line endings.

Hi, I’ve run into the same issue creating the .sh file in vscode. Is there a way to save it without having to run dos2unix?

1 Like

For vscode, just press CRLF in the status bar while opening the .sh file, select LF then save the file.

8 Likes

I also happen to get this when I compile a go program and put it in a container using multi-stage building.

In my case the solution was to add CGO_ENABLED=0 to the go build line.

2 Likes

some kind of monster, save my day!

Holy, I was going mad with this error converting to LF did the trick for me Tnx

Hi, All of my files are in LF format but I still get the error

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

While it works properly on my local machine, this problem arised only when we deployed it to cluster through bit bucket/bamboo pipeline

Any help much appreciated. Thank you.