Antony Hutchison
Antony Hutchison

Reputation: 3031

Podman pull 'official' images from docker hub?

No matter what I do, I only ever get a 404 or Error: invalid reference format

I think it should be podman pull hub.docker.com/_/postgres

but this doesn't work. I've also tried

podman pull hub.docker.com/postgres

podman pull hub.docker.com/__/postgres

podman pull hub.docker.com/library/postgres

Any ideas what's needed here to grab any of the official images from Docker Hub?

Upvotes: 48

Views: 81406

Answers (3)

popeye
popeye

Reputation: 896

Apart from editing /etc/containers/registries.conf, it is also possible to set aliases for some specific repositories in:

/etc/containers/registries.conf.d/shortnames.conf

E.g. put the following into shortnames.conf:

[aliases]
  "orclinx" = "container-registry.oracle.com/os/oraclelinux"

And after that podman pull orclinx will pull from the image from the assigned repository.

P.S.: Although the question specifically asks about pulling repositories from official docker hub repos, it might be useful for other folks ending up here.

Upvotes: 0

Jonathan Komar
Jonathan Komar

Reputation: 3086

Either follow the other answer and use a fully-qualified image name or you can add docker.io to your set of unqualified search registries:

/etc/containers/registries.conf

unqualified-search-registries = ["mylocalregistry:5005", "docker.io"]

This will make it possible to use docker.io as a fall back with unqualified image names like:

podman pull nginx

Upvotes: 29

Antony Hutchison
Antony Hutchison

Reputation: 3031

In order to pull images from Docker Hub using podman, the image name needs to be prefixed by the docker.io/ registry name.

To get the 'official images' they are part of the 'library' collection.

So to pull Postgres from Docker Hub using Podman, the command is

podman pull docker.io/library/postgres

Upvotes: 106

Related Questions