Note for myself, and for any begineer that might encounter this problem.
In short, always save linebreak as LF(Unix) rather than CRLF(Windows).
I encounter this problem when I want to make a custom docker image that do a simple thing: Git Clone.
The Dockerfile
looks like this:
FROM alpine:latest
RUN apk --no-cache add \
git
VOLUME [ "/data" ]
ENTRYPOINT [ "/cloning.sh" ]
COPY cloning.sh /
It cannot be any simpler - but somehow docker put out an error:
standard_init_linux.go:185: exec user process caused "no such file or directory"
This is the cloning.sh
:
#!/bin/sh
cd /data
git clone http://192.168.1.100:3000/owenhsieh/repo1.git
git clone http://192.168.1.100:3000/owenhsieh/repo2.git
git clone http://192.168.1.100:3000/owenhsieh/repo3.git
git clone http://192.168.1.100:3000/owenhsieh/repo4.git
git clone http://192.168.1.100:3000/owenhsieh/repo5.git
It doesn't make sense. So next I tryout install bash and remove #!/bin/sh
incase it might somehow not having shell.
Then it first put out : No such file or directoryata
then do git clone
.
Still make no sense - then I notice directoryata
.
So I check my linebreak.
Yep.