Podman 构建命令无法拉取镜像

时间:2021-02-18 10:55:32

标签: rhel7 podman

我在RHEL7中安装Podman后配置了Subuid和Subgid

我创建了一个简单的 Dockerfile 来打印 hello world 并尝试构建映像。 我的 Dockerfile

FROM alpine
CMD ["echo", "Hello World"]

为了测试我在命令下运行

Podman build -t imagename .

我看到收到以下错误。

STEP 1: FROM alpine
Error: error creating build container: The following failures happened while trying to pull image specified by "alpine" based on search registries in /etc/containers/registries.conf:
* "localhost/alpine": Error initializing source docker://localhost/alpine:latest: error pinging docker registry localhost: Get https://localhost/v2/: dial tcp [::1]:443: connect: connection refused
* "registry.access.redhat.com/alpine": Error initializing source docker://registry.access.redhat.com/alpine:latest: error pinging docker registry registry.access.redhat.com: Get https://registry.access.redhat.com/v2/: read tcp 10.70.85.174:17758->23.54.147.129:443: read: connection reset by peer
* "registry.redhat.io/alpine": Error initializing source docker://registry.redhat.io/alpine:latest: error pinging docker registry registry.redhat.io: Get https://registry.redhat.io/v2/: read tcp 10.70.85.174:36028->104.79.150.216:443: read: connection reset by peer
* "docker.io/library/alpine": Error initializing source docker://alpine:latest: error pinging docker registry registry-1.docker.io: Get https://registry-1.docker.io/v2/: read tcp 10.70.85.174:53352->18.213.137.78:443: read: connection reset by peer

我是否缺少任何配置?

谢谢

2 个答案:

答案 0 :(得分:0)

建议您先在注册表中搜索您的图片

podman search alpine

您应该获得可用图像列表。选择您想要的一个 - 版本、名称、标签等并将其放入 dockerfile 中。

要确保它可以访问,请手动“拉”

podman pull alpine<version,tag>

答案 1 :(得分:0)

您是否仍在运行和/或安装了 docker?

首先停止docker Daemon

 sudo systemctl stop docker 

 sudo service docker stop

然后卸载docker Ubuntu 在这里,但你需要什么都可以谷歌:D

sudo apt-get remove docker docker-engine docker.io containerd runc

再试一次,

如果其他失败,现在尝试刷新安装 podman

sudo --reinstall install podman

来源

https://www.cyberciti.biz/faq/debian-ubuntu-linux-reinstall-a-package-using-apt-get-command/
https://askubuntu.com/questions/935569/how-to-completely-uninstall-docker
https://intellipaat.com/community/43965/how-to-stop-docker
https://podman.io/getting-started/installation