我试图简单地创建一个 dockerfile,在 centOS 映像上安装 wget 和解压缩。这是文件:
FROM centos:latest
EXPOSE 9000
RUN echo "proxy=http://xxx.xxx.xxx.xxx:x" >> /etc/yum.conf \
&& echo "proxy_username=username" >> /etc/yum.conf \
&& echo "proxy_password=password" >> /etc/yum.conf \
&& yum update \
&& yum -y install wget unzip
...
Run Code Online (Sandbox Code Playgroud)
当我运行构建时,它很好地解决了依赖关系,但它似乎没有遵守 -y 标志并假设任何提示均为“是”:
Total download size: 61 M
Is this ok [y/d/N]: Exiting on user command
Your transaction was saved, rerun it with:
yum load-transaction /tmp/yum_save_tx.2018-08-08.21-22.Q7f8LW.yumtx
The command '/bin/sh -c yum update && yum -y install wget unzip' returned
a non-zero …Run Code Online (Sandbox Code Playgroud)