Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Container Registry
  • Getting started
    • All guides
    • Installing and configuring Docker
    • Authentication in Container Registry
      • Getting information about existing Docker images
      • Creating a Docker image
      • Pushing a Docker image to a registry
      • Pulling a Docker image from a registry
      • Deleting a Docker image from a registry
    • Scanning Docker images for vulnerabilities
    • Creating a trigger for a registry
  • Yandex Container Solution
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Troubleshooting
  • FAQ
  1. Step-by-step guides
  2. Managing a Docker image
  3. Creating a Docker image

Creating a Docker image

Written by
Yandex Cloud
Updated at February 7, 2025

This guide describes how to create and build a Docker image based on a Dockerfile.

To work with Docker images, install and configure Docker.

CLI
  1. Create a file named Dockerfile on your device and add the below 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.

  2. Assemble the Docker image. For <registry_ID>, use the ID you got when creating the registry.

    docker build . \
      -t cr.yandex/<registry_ID>/ubuntu:hello
    

    The -t flag assigns a URL to the Docker image in this format: cr.yandex/<registry_ID>/<Docker_image_name>:<tag>. You can build Docker images without any tag. In this case, the Docker CLI will provide the default label: latest.

Once these commands are executed, a Docker image will be created in your repository with the hello tag and the full address of the repository, which includes:

  • Container Registry address: cr.yandex.
  • Your registry ID: <registry_ID>.
  • Name of your repository: ubuntu.

Was the article helpful?

Previous
Getting information about existing Docker images
Next
Pushing a Docker image to a registry
© 2025 Direct Cursus Technology L.L.C.