Pushing a Docker image to a registry
Written by
Updated at September 23, 2024
These instructions describe how to push a local Docker image to a registry.
Note
To push an image, you need to configure Docker and get authenticated in the registry.
To push a Docker image to the registry, you need the container-registry.images.pusher
role or higher.
CLI
-
View the list of available Docker images:
docker image list
Result:
REPOSITORY TAG IMAGE ID CREATED SIZE cr.yandex/crpd50616s9a********/ubuntu hello 50ff******** 23 hours ago 86.7MB ubuntu latest 1d9c******** 2 weeks ago 86.7MB
-
(Optional) Assign to the Docker image a URL in
cr.yandex/<registry_ID>/<Docker_image_name>:<tag>
:docker tag ubuntu \ cr.yandex/<registry_ID>/ubuntu:hello
Note
You can only push Docker images to Container Registry if they have a URL in this format:
cr.yandex/<registry_ID>/<Docker_image_name>:<tag>
. -
Push the required Docker image to the registry:
docker push cr.yandex/<registry_ID>/ubuntu:hello
-
Make sure the image has been pushed to the registry by getting a list of docker images in the registry.