How to push an image to the Docker registry using podman
Asked Answered
U

3

7

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.

Uniformitarian answered 4/10, 2020 at 19:42 Comment(0)
C
5

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
Chappy answered 8/4, 2022 at 21:53 Comment(1)
I guess because you build with localhost/myimage. Why dont you tag it with myuser/myimage right away?Creath
C
0

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

Creath answered 8/4, 2022 at 23:40 Comment(0)
U
-1

It was enough to specify the address of the docker registry

docker push imageID docker://docker.io/username/ImageName:tag
Uniformitarian answered 9/10, 2020 at 14:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.