我正在尝试从 amazonlinux (基于 Fedora)构建一个容器。
如果我构建映像并进入容器,则 yum 命令可以正常工作。但是,如果我将 yum 命令放入 Dockerfile 中,则不会。似乎无法联系存储库
Dockerfile
FROM amazonlinux
RUN yum update -y
Run Code Online (Sandbox Code Playgroud)
运行: sudo docker build 。
Sending build context to Docker daemon 3.072kB
Step 1/2 : FROM amazonlinux
---> df7d0b6ddeee
Step 2/2 : RUN yum update -y
---> Running in 14e4e4bad5b1
Loaded plugins: ovl, priorities
Run Code Online (Sandbox Code Playgroud)
结果尝试了几个https,最后:
...URLError: (28, 'Resolving timed out after 5516 milliseconds')
Trying other mirror...
The command '/bin/sh -c yum update -y' returned a non-zero code: 1
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
20431 次 |
| 最近记录: |