Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

standard_init_linux.go:178: exec user process caused "no such file or directory" #215

Closed
GingerMoon opened this issue Mar 31, 2017 · 32 comments
Assignees

Comments

@GingerMoon
Copy link

Which lab is it that you're having issues with?
In-container Java Development: IntelliJ Community Edition
https://github.com/docker/labs/blob/master/developer-tools/java-debugging/IntelliJ-README.md

Description

I got the error below after running the command: docker-compose up
webserver_1 | standard_init_linux.go:178: exec user process caused "no such file or directory"

Steps to reproduce the issue, if relevant:
Do the same as described in the link:
https://github.com/docker/labs/blob/master/developer-tools/java-debugging/IntelliJ-README.md
But is blocked at:
Running the application
Open a terminal and go to the application directory. Start the application with docker-compose

docker-compose up

Describe the results you received:
webserver_1 | standard_init_linux.go:178: exec user process caused "no such file or directory"

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Docker version 17.03.1-ce, build c6d412e
Windows10 Enterprise
default

@GingerMoon
Copy link
Author

Tried with
git clone https://github.com/spara/registration-docker.git --config core.autocrlf=input
Still doesn't work.

@ManoMarks
Copy link
Contributor

@GingerMoon were you in the root of the application directory when you ran docker-compose up? Here's what it looks like for me:
screen shot 2017-03-31 at 12 35 50 pm

@GingerMoon
Copy link
Author

@ManoMarks Thank you very much for the prompt response!
git clone https://github.com/spara/registration-docker.git --config core.autocrlf=input
default

@GingerMoon
Copy link
Author

Hi guys,
Any update?

Regards,

@spara
Copy link
Contributor

spara commented Apr 26, 2017

Hi GingerMoon,

I was able to replicate your problem which is the LF character in dos/cygwin/Powershell is converted to CRLF when the repo is pushed to github. This occurs on a Windows 10 machine in either the Windows git client or Powershell. Use dos2unix to fix the affected files

dos2unix  ../labs/developer-tools/java-debugging/registration-webserver/tomcat/tomcat-users.xml
dos2unix  ../labs/developer-tools/java-debugging/registration-webserver/tomcat/run.sh

@spara spara closed this as completed Apr 26, 2017
@GingerMoon
Copy link
Author

Hi spara,
Thank you for your reply. It doesn't work.
default

@GingerMoon
Copy link
Author

@spara

@spara
Copy link
Contributor

spara commented May 4, 2017

Did you rebuild the containers to use the files that were changed?

docker-compose up --build

@GingerMoon
Copy link
Author

many thanks!

@snail9367
Copy link

Hi GingerMoon, did you solve the problem?

@spara
Copy link
Contributor

spara commented May 16, 2017

How to run tutorial in Windows:

dos2unix  ../labs/developer-tools/java-debugging/registration-webserver/tomcat/tomcat-users.xml
dos2unix  ../labs/developer-tools/java-debugging/registration-webserver/tomcat/run.sh
docker-compose up --build

@lwsgh
Copy link

lwsgh commented May 29, 2017

it's caused by git for windows, line breaks are forced to dos format
step 1: git config --global core.autocrlf false
step 2: delete code and git clone again

@jchavannes
Copy link

jchavannes commented Jan 3, 2018

I am having similar issue:

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

This error message doesn't give me much of a clue what might be the error. Been struggling for a few hours to try to fix but don't really even know where to start :(

Btw, I am not using windows and using dos2unix didn't fix it. No matter what I try I get this error...

@spara
Copy link
Contributor

spara commented Jan 3, 2018

Which operating system are you using and what version of Docker?

@spara spara reopened this Jan 3, 2018
@jchavannes
Copy link

@spara Mac and Docker for Mac, version 17.12.0-ce-rc2-mac41 (21193).

I have a go binary and am using FROM scratch. It works for a hello world binary, but when I put a more complicated one in there I get this error.

@spara
Copy link
Contributor

spara commented Jan 3, 2018

Can you post your Dockerfile?

@jchavannes
Copy link

FROM scratch
ADD main /
CMD ["/main"]

@spara
Copy link
Contributor

spara commented Jan 3, 2018

OK, I see the problem. You're probably building your go binary on the Mac and trying to run it in Linux container. Try this when building your go binary:

env GOOS=linux GOARCH=386 go build hello-world.go

@jchavannes
Copy link

I'm building using the golang:1.8 docker container. Like I said, hello world works, I'm only having this issue with a larger project. Also, the binary I'm building works in an Ubuntu container, so I know it's building for linux just fine.

I'm also using CGO_ENABLED=0 and have tried adding -ldflags '-w -extldflags "-static"' to ensure it doesn't have any dependencies.

And even so, if the binary was built incorrectly, why would it give an error that it cannot find the file?

@ManoMarks
Copy link
Contributor

I don't think this is related to a specific lab we have on this repo @jchavannes, is it? The lab originally referred to was a Java debugging in IntelliJ lab. I realize this comes up second in the Google search for standard_init_linux.go:178: exec user process caused "no such file or directory" docker but if it's not related to one of these labs, I suggest you try the Docker Forums (https://forums.docker.com/) or the Docker Community Slack (https://community.docker.com).

@jchavannes
Copy link

Ok, thanks..

@Jacksonary
Copy link

Hi GingerMoon,I have same trouble with you,have you deal with it?

@Jacksonary
Copy link

@GingerMoon

@hafah
Copy link

hafah commented Jan 12, 2018

@Jacksonary

maybe its the crlf on all your files.

git config --global core.eol lf
git config --global core.autocrlf input
find . -type f -print0 | xargs -0 dos2unix

@anshupitlia
Copy link

@jchavannes Hey I am facing the same issue, were you able to solve it?

@jchavannes
Copy link

@anshupitlia nope, I was not able to solve it and gave up on FROM scratch containers :/

Btw, I ended up posting this question on docker forums as well - https://forums.docker.com/t/standard-init-linux-go-195-exec-user-process-caused-no-such-file-or-directory/43777

@Jacksonary
Copy link

Jacksonary commented Jan 20, 2018 via email

@winex01
Copy link

winex01 commented Feb 3, 2018

@jchavannes i have the same problem. did you solve it?

@oranheim
Copy link

oranheim commented Feb 9, 2018

Experiencing the same issue with Docker engine 17.12.0-ce on Windows 10. The image that fails is built using FROM openjdk:8-alpine.

@aguilita1
Copy link

aguilita1 commented Feb 10, 2018

@oranheim I was able to resolve issue by adjusting LF setting with GIT (See below), remove git repo, and then rebuilding from fresh repo.

git config --global core.eol lf
git config --global core.autocrlf input

@oranheim
Copy link

oranheim commented Feb 12, 2018

@aguilita1 is this related to docker git sources config, or my image's git config?

Will this be fixed in a coming docker release?

@ManoMarks
Copy link
Contributor

I'm locking this issue going forward. Please migrate discussions/bugs to https://github.com/docker/for-linux, https://github.com/docker/for-mac, https://github.com/docker/for-win or https://github.com/moby/moby
this repo is for Docker labs and the comments here are not directly related to the labs.

@docker docker locked as off-topic and limited conversation to collaborators Feb 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests