docker - RUN命令抛出 “not found”

标签 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

回声:
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/

相关文章:

bash - 如何将命令行参数传递给docker-compose run?

linux - 管理器和工作节点上的 Docker Swarm 复制

image - Docker镜像层次结构会增加层大小吗?

docker - standard_init_linux.go :190: exec user process caused "no such file or directory" - Docker

docker - 具有相同 image_id 的多个 docker 镜像

docker - Docker构建docker镜像:用户权限/主机问题

默认为后台运行的 Dockerfile 选项(分离)

Docker 在不同的端口上运行容器

scala - GKE 上 docker 中的 scala 应用程序未终止系统

docker - Dockerfiles 可以链接其他 Dockerfiles 吗?