我有Docker文件:
FROM ubuntu:18.04
COPY mylib/src /usr/src
WORKDIR /usr/src
RUN chmod +x configure.sh
RUN ls -l # it display all files, included configure.sh
RUN ./configure.sh # error there
回声:
RUN ls -l
---> Running in d9ba6b10ed2a
total 604
...
-rwxr-xr-x 1 root root 91 Oct 28 07:30 configure.sh
...
RUN ./configure.sh
---> Running in 2e3e8fdca28e
/bin/sh: 1: ./configure.sh: not found
The command '/bin/sh -c ./configure.sh' returned a non-zero code: 127
文件configure.sh存在,但是发生错误:找不到
我仅在Windows PC上有此问题。
最佳答案
Okaaaay ...问题出在Windows样式的行分隔符中。我在configure.sh中将CRLF更改为LF,它可以工作!
关于docker - RUN命令抛出 “not found”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58623721/