'Dockerfile RUN - file not found
I'm trying to execute (RUN) a script but I'm getting a not file found error:
The line is: RUN settings/certs/install-certs.sh
The other lines that use files from the same path don't cause any issues.
What Am I missing here?
Dockerfile:
FROM container-registry.foo.net/maven:3.6.1-alpine as build
WORKDIR /app
COPY . .
RUN chmod +x settings/certs/install-certs.sh
RUN settings/certs/install-certs.sh
RUN mvn clean install -s settings/maven/docker-settings.xml
Output:
Sending build context to Docker daemon 218MB
Step 1/13 : FROM container-registry.foo.net/maven:3.6.1-alpine as build
---> 7445f83cd169
Step 2/13 : WORKDIR /app
---> Using cache
---> b08dcd4a3395
Step 3/13 : COPY . .
---> Using cache
---> c843717f9c58
Step 4/13 : RUN chmod +x settings/certs/install-certs.sh
---> Using cache
---> 17c6546c749b
Step 5/13 : RUN settings/certs/install-certs.sh
---> Running in 106d58b6bb25
/bin/sh: settings/certs/install-certs.sh: not found
The command '/bin/sh -c settings/certs/install-certs.sh' returned a non-zero code: 127
Solution 1:[1]
It turn out the line separator was the reason of the failure, replacing CRLF
to LF
did the trick.
Hard to identify when the error says "file not found".
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | VeryNiceArgumentException |