How to push an image to the Docker registry using podman

14.8k views Asked by At

Is it possible to push images to the Docker registry using podman?

I am running podman with the podman-docker (that claims to emulate the Docker CLI) package on fedora and I managed to successfully run docker login with my hub.docker.com credentials, but when I try to push an image it fails to connect.

3

There are 3 answers

0
afiori On

It was enough to specify the address of the docker registry

docker push imageID docker://docker.io/username/ImageName:tag
0
The Fool On

I did add dockerhub to my registries.conf. Not sure if its stricly required.

$ cat /etc/containers/registries.conf
[registries.search]
registries = ['docker.io', 'quay.io']

But I can just push as you would expect with docker.

podman build -t myuser/myimage .
podman login -u myuser
podman push myuser/myimage

podman version is 3.4.2

1
Daniel Viglione On

For me, I had to be more explicit than the answer above:

podman system prune -a
podman login -u myuser -p mypassword  docker.io/myuser/myimage
podman build -t localhost/myimage .
$ podman images
REPOSITORY                TAG            IMAGE ID      CREATED             SIZE
localhost/myimage           latest         1546573dd25d  About a minute ago  716 MB
docker.io/library/docker  19.03.12-dind  66dc2d45749a  20 months ago       227 MB

podman push 1546573dd25d docker://docker.io/myuser/myimage:1.0.0