Creating a Docker image
The instructions describe how to create and build a Docker image from a Dockerfile.
CLI
-
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 theID
received when creating the registry.docker build . \ -t cr.il.nebius.cloud/<registry ID>/ubuntu:hello
The
-t
flag assigns a URL in the formatcr.il.nebius.cloud/<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:latest
.
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
cr.il.nebius.cloud
. - ID of your registry
<registry ID>
. - Name of your
ubuntu
repository.