Creating a Docker image
Warning
Starting October 13, 2026, Yandex Container Registry will be unavailable to new users.
The existing users can create resources until November 10, 2026. Afterwards, Yandex Container Registry will go read-only and cease to operate on December 14, 2026. For more information on how it will be handled, see this article on Yandex Container Registry sunset.
This guide describes how to create and build a Docker image based on a Dockerfile.
To work with Docker images, install and configure Docker.
-
Create a Dockerfile on your device and add the following lines to it:
FROM ubuntu:latest CMD echo "Hi, I'm inside"The described Docker image is based on Ubuntu and will run one simple command.
-
Build the Docker image. For
<registry_ID>, use theIDyou got when creating the registry.docker build . \ -t cr.yandex/<registry_ID>/ubuntu:helloThe
-tflag assigns a URL to the Docker image in this format:cr.yandex/<registry_ID>/<Docker_image_name>:<tag>. You can build Docker images without specifying a tag. In this case, the Docker CLI will provide the default label:latest.The Docker image name and tag are part of the repository name, which is a URI
, and must follow a specific format. For more information, see the OCI Distribution Specification .
After you run these commands, a Docker image with the hello tag will appear in your repository. The full repository address will contain:
- Container Registry address:
cr.yandex. - Your registry ID:
<registry_ID>. - Name of your repository:
ubuntu.