linux - Docker 构建失败 : returned a non-zero code: 1

标签 linux docker dockerfile

Dockerfile1

FROM ubuntu:latest
MAINTAINER ME
RUN apt-get update
RUN apt-get update && apt-get install -y net-tools \
&& apt-get install inetutils-traceroute \
&& apt-get install iputils-ping \
&& apt-get install xinetd telnetd

Dockerfile2

FROM ubuntu:latest
MAINTAINER ME
RUN apt-get update
RUN apt-get update && apt-get install -y net-tools
RUN apt-get update && apt-get install inetutils-traceroute
RUN apt-get update apt-get install iputils-ping
RUN apt-get install xinetd telnetd

Dockerfile3

FROM ubuntu:latest
MAINTAINER ME
RUN apt-get update
RUN apt-get install inetutils-traceroute
RUN apt-get install -y net-tools
RUN apt-get update apt-get install iputils-ping
RUN apt-get install xinetd telnetd

我尝试了上述所有类型的 dockerfile,但每次都出现相同的错误:

The command '/bin/sh -c apt-get update && apt-get install -y net-tools && apt-get install inetutils-traceroute && apt-get install iputils-ping && apt-get install xinetd telnetd' returned a non-zero code: 1

最佳答案

有人发布了一个答案,我还没来得及接受就把它删了。但它在这里 -

FROM ubuntu:latest
MAINTAINER ME

RUN apt-get update && apt-get install -y \
net-tools inetutils-traceroute \
iputils-ping xinetd telnetd

这行得通!!

关于linux - Docker 构建失败 : returned a non-zero code: 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46110294/

相关文章:

postgresql - 如何通过容器内的 cron 转储数据库?

docker - 如何为我的项目的多个版本共享一个Dockerfile?

linux - Alljoyn编译错误

ruby-on-rails - docker-compose 重启连接池已满

正则表达式使用文件名 shell 脚本过滤文件

docker - 错误:找不到指定的Dockerfile:Dockerfile-dev

docker - docker-compose中的hostname属性

Dockerfile RUN 层与脚本

linux - 如何使用 grep、sed 和 awk 打印找到的模式后的下一个单词?

linux - '#pragma GCC optimize ("O 3")' 是什么意思?