Docker 运行命令抛出;“未找到”;
我有Docker文件:Docker 运行命令抛出;“未找到”;,docker,dockerfile,Docker,Dockerfile,我有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 回声: 文件configure.sh存在,但出现错误:找不到 我只有在我的Windows电脑上才有此问题。好的。。。问题出现在
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
回声:
文件configure.sh存在,但出现错误:找不到
我只有在我的Windows电脑上才有此问题。好的。。。问题出现在Windows样式的行分隔符中。我在configure.sh中将CRLF更改为LF,它就工作了
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