Docker Build in windows ERROR — no such file or directory
Hi All,
Generally when we are building docker image from windows system and using entry.sh or any shell file generally it may give error as — no such file or directory, standard_init_linux.go 207 no such file or directory
So above are the error which will cause not run shell script inside docker environment
So whenever we run below command on windows docker build we can encounter below scenario
first we have entery.sh point declare on the docker file
Docker build -t demo/tutorial1:latest .
When build is completed and try to run the command
docker run demo/tutorial1:latest
We can get — below error
standard_init_linux.go xxx no such file or directory
So solution to this is
- Very easy one that i love it as i have do lots of dig up about finding the correct solution
Every one was talking about changing file structure from CRLF to LF
I was clue less how to that some how i find below steps which work for me
In Your visual studio code/In your editor you will find the right side corner
Clicking on highlighted one and then chose as LF as below screen
That’s it and recompile the docker and it should work just fine
2) You can also try below steps if you want but i was able to solve this problem from change from CRLF to LF
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”]
That’s it i think this will solve your problem
Comment below if you have any other way to solve the problem happy hacking :)