linux - 在docker镜像“centos/python-36-centos7”中运行yum install时如何找到http url
问题描述
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
提前致谢!
解决方案
我想这就是你要找的,
官方镜像的 docker 注册路径为library/(image)
,示例如下,
docker pull registry.hub.docker.com/library/busybox
推荐阅读
- spring-boot - Spring Data Neo4J @Index(unique = true) 不起作用
- azure - 从部署在 Azure node.js 函数上的 graphQL 解析器中的 API 获取数据
- c - 如何从c中的数组中删除一系列元素
- php - PHP - 从数组中获取第一个和最后一个键和值
- flutter - how can I show document?
- bash - bash 变量替换就在另一个字符串旁边
- python-3.x - 模块 'cv2.cv2' 没有属性 'sift'
- java - 将 RTP over TCP 重播为 RTP over UDP
- laravel - 以某种格式显示日期并将其存储在其他格式中(Laravel 中的 Datepicker)
- matlab - 为 Matlab 设置 Sublime Text 或替代编辑器?