小编Nat*_*nch的帖子

yum -y install 在 docker build 中不假设是

我试图简单地创建一个 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)

yum docker centos7 dockerfile

5
推荐指数
1
解决办法
7522
查看次数

标签 统计

centos7 ×1

docker ×1

dockerfile ×1

yum ×1