Image 为什么Podman试图从文件中加载一个已经存在的图像?

Image 为什么Podman试图从文件中加载一个已经存在的图像?,image,containers,coreos,podman,Image,Containers,Coreos,Podman,我在一个空气间隙的环境中工作,运行着与Podman一起打包的Fedora CoreOS。我有几个集装箱图片,我一直致力于将其运输到空气间隙的环境中。为此,我遵循了以下步骤: 我在一台可以上网的机器上获取了这些图像。一些图像是使用Podman-pull-Docker-daemon:Docker.io/my-example-image:latest从我的Docker注册表拉入Podman的,而一些图像是使用Podman-pull直接从在线存储库拉入的 我使用(例如)podman save docke

我在一个空气间隙的环境中工作,运行着与Podman一起打包的Fedora CoreOS。我有几个集装箱图片,我一直致力于将其运输到空气间隙的环境中。为此,我遵循了以下步骤:

  • 我在一台可以上网的机器上获取了这些图像。一些图像是使用
    Podman-pull-Docker-daemon:Docker.io/my-example-image:latest
    从我的Docker注册表拉入Podman的,而一些图像是使用
    Podman-pull
    直接从在线存储库拉入的
  • 我使用(例如)
    podman save docker.io/my example image:latest-o my example image.tar将图像保存到tar文件中
  • 我将tar文件传输到物理介质上的空气间隙环境中,并使用
    podmanload-I我的示例image.tar加载它们
  • 当我使用
    podman images
    检查图像时,它们都出现在图像列表中。但是,如果我尝试从其中一个映像运行容器,使用
    sudo podman run docker.io/my example image
    我会收到一条很长的错误消息:

    Trying to pull docker.io/my-example-image
    Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on [::1}:53: read udp [::1]:50762 ->
      [::1]:53: read: connection refused
    Error: unable to pull docker.io/my-example-image: Error initializing source docker://my-example-image:latest:
      error pinging docker registry registry-1.docker.io: Get "https://registry-1.docker.io/v2/": dial tcp: lookup
      registry-1.docker.io on [::1]:53: read udp [::1]50762 -> [::1]:53: read: connection refused
    
    对于从其他存储库(如
    quay.io

    在我看来,这个错误是由于机器无法与注册表建立连接造成的,考虑到环境是气隙的,这对我来说是有意义的。但我不知道为什么podman甚至试图提取这些图像,而它们已经存在于环境中,正如
    podman images

    我尝试过在
    podman run
    命令中使用各种方法引用图像,包括

    sudo-podman-run-docker.io/my-example-image:latest
    sudopodman运行我的示例图像
    sudopodman运行我的示例图像:最新


    我尝试过寻找解决此问题的方法,但没有任何效果,我非常感谢您的指导。

    每个用户都有自己的容器存储

    用户root使用目录/var/lib/containers/

    普通用户使用~/.local/share/containers目录/

    命令
    podman加载-i我的示例图像.tar
    将使用~/.local/share/containers目录/

    命令
    sudo-podman-run-docker.io/my-example-image
    将使用目录/var/lib/containers

    如果要在用户之间共享只读容器存储, 查看文件storage.conf中的additionalimagestores设置

    参考:

    [storage.options]
    additionalimagestores = [ "/var/lib/mycontainers",]