Creating a Docker image
The instructions describe how to create and build a Docker image from a Dockerfile.
Create a file named Dockerfile 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 execute one simple command.
Assemble the Docker image. For
<registry ID>, use the
IDreceived when creating the registry.
docker build . \ -t cr.yandex/<registry ID>/ubuntu:hello
-tflag assigns a URL in the format
cr.yandex/<registry ID>/<Docker image name>:<tag>to the Docker image. You can build Docker images without any tag. In this case, the Docker CLI will assign the default label:
Once completed, these commands will create a Docker image with the
hello tag in your repository as well as the full address of the repository, including:
- Container Registry service address
- ID of your registry
- Name of your