【发布时间】:2020-12-01 08:03:06
【问题描述】:
docker 在私有子网中运行,我需要打开基于 url 的白名单才能连接 Internet。比如我添加“.fedoraproject.org”,那么在这个docker中,我们可以访问https://dl.fedoraproject.org。
但是现在,当我 yum install package 时,我不知道如何检查“centos/python-36-centos7”使用的是哪个http url。
这是我的 Dockerfile 的一部分:
FROM centos/python-36-centos7
# ...
RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
#needed by git-codecommit
# RUN yum -y install https://packages.endpoint.com/rhel/7/os/x86_64/endpoint-repo-1.7-1.x86_64.rpm
RUN wget https://packages.endpoint.com/rhel/7/os/x86_64/endpoint-repo-1.7-1.x86_64.rpm
RUN yum localinstall -y endpoint-repo-1.7-1.x86_64.rpm
RUN yum -y install git aws-cli cmake3
这条命令yum -y install git aws-cli cmake3超时:
https://packages.endpoint.com/rhel/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://packages.endpoint.com/rhel/7/os/x86_64/repodata/repomd.xml: (28, 'Operation timed out after 30001 milliseconds with 0 out of 0 bytes received')
https://packages.endpoint.com/rhel/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://packages.endpoint.com/rhel/7/os/x86_64/repodata/repomd.xml: (28, 'Operation timed out after 30001 milliseconds with 0 out of 0 bytes received')
https://packages.endpoint.com/rhel/7/os/x86_64/repodata/repomd.xml: [Errno 12] Timeout on https://packages.endpoint.com/rhel/7/os/x86_64/repodata/repomd.xml: (28, 'Operation timed out after 30001 milliseconds with 0 out of 0 bytes received')
[0mThe command '/bin/sh -c yum -y install git aws-cli cmake3' returned a non-zero code: 1
提前致谢!
【问题讨论】: