Search code examples
podman

Podman Play does not pull localhost image: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused


I generated a YAML definition for my pod running three containers (infra, mariadb and a local container image):

podman generate kube > my-pod.yaml

Then I want to deploy using the definition:

podman play kube my-pod.yaml

When I want to bring it up, podman seems to avoid pulling normal image from localhost. Error is:

Trying to pull localhost/myimg:latest... Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused Error: unable to pull localhost/myimg:latest: Error initializing source docker://localhost/myimg:latest: error pinging docker registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused

How can I override this behavior of podman? There is already a successful usage of this method of container management here, but in that example, there is no local image; only images from repositories are used.


Solution

  • I just ran into this and sorted it out by removing the ":latest" tag from the pod image. When the :latest tag is present, that causes podman to Always attempt to pull the image from the remote repository, as described here - https://kubernetes.io/docs/concepts/containers/images/