Podman构建命令无法拉取镜像

use*_*401 5 rhel7 podman

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

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

FROM alpine
CMD ["echo", "Hello World"]
Run Code Online (Sandbox Code Playgroud)

为了测试我正在运行以下命令

Podman build -t imagename .
Run Code Online (Sandbox Code Playgroud)

我看到收到以下错误。

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
Run Code Online (Sandbox Code Playgroud)

我是否缺少任何配置?

谢谢

Bob*_*onk 0

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

首先停止docker守护进程

 sudo systemctl stop docker 
Run Code Online (Sandbox Code Playgroud)

或者

 sudo service docker stop
Run Code Online (Sandbox Code Playgroud)

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

sudo apt-get remove docker docker-engine docker.io containerd runc
Run Code Online (Sandbox Code Playgroud)

再试一次,

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

sudo --reinstall install podman
Run Code Online (Sandbox Code Playgroud)

来源

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
Run Code Online (Sandbox Code Playgroud)