Skip to main content
Container Registry helps to manage Docker images for your resources. This guide covers how to set up your environment to work with the service, create your first registry, upload and run a Docker image in it.

Prepare your environment

In this guide, you will use the terminal in your environment, e.g. on your local machine, to run commands that create and manage Nebius AI Cloud resources. The commands use the Nebius AI Cloud CLI and tools that you need to install first.
  1. Install Docker Engine.
  2. Install jq (how to install) which parses JSON outputs from the Nebius AI Cloud CLI and extracts resource IDs for other commands:
    sudo apt-get install unzip jq
    
  3. Install the Nebius AI Cloud CLI (how to install) which manages all Nebius AI Cloud resources:
    curl -sSL https://storage.eu-north1.nebius.cloud/cli/install.sh | bash
    
  4. Configure the Nebius AI Cloud CLI:
    nebius profile create
    
The last command, nebius profile create, will open the sign-in screen of the Nebius AI Cloud web console in your browser. Sign in to the web console to complete the initialization. After that, save your project ID in the CLI configuration:
  1. Copy your project ID from the web console:
    1. Go to the web console and then expand the top list of projects.
    2. Next to the project’s name, click https://mintcdn.com/nebius-ai-cloud/1Ha0sWR6e1mnIaHS/_assets/button-vellipsis.svg?fit=max&auto=format&n=1Ha0sWR6e1mnIaHS&q=85&s=e80b8e57c43bfd117679262e6a1334adCopy project ID.
  2. Add the project ID to the CLI configuration:
    nebius config set parent-id <project_ID>
    
  3. Create an environment variable for the region in which your project is located:
    export NB_REGION_ID=<region_ID>
    

Create a registry

Create a test registry and save a part of its ID to an environment variable:
export NB_REGISTRY_PATH=$(nebius registry create \
  --name quickstart-registry \
  --format json | jq -r ".metadata.id" | cut -d- -f 2)

Configure Docker

Configure Docker to work with the created registry:
  1. Run the Nebius AI Cloud Docker credential helper. It lets you use Nebius AI Cloud registries without running the docker login.
    nebius registry configure-helper
    
  2. Check that the credential helper is configured:
    1. Open the file from the previous command output, for example, with the cat command:
      cat /Users/user/.docker/config.json
      
    2. Check that the credHelpers property contains the following lines:
      "cr.eu-north1.nebius.cloud": "nebius"
      "cr.eu-north2.nebius.cloud": "nebius"
      "cr.eu-west1.nebius.cloud": "nebius"
      "cr.me-west1.nebius.cloud": "nebius"
      "cr.uk-south1.nebius.cloud": "nebius"
      "cr.us-central1.nebius.cloud": "nebius"
      

Push and run a Docker image

  1. Pull an image from the Docker Hub:
    docker pull hello-world
    
    Do not run the command as root.
  2. Assign the image a tag:
    docker tag hello-world \
      cr.$NB_REGION_ID.nebius.cloud/$NB_REGISTRY_PATH/hello-world:hello
    
  3. Push the image to the Container Registry:
    docker push cr.$NB_REGION_ID.nebius.cloud/$NB_REGISTRY_PATH/hello-world:hello
    
    Do not run the command as root.
  4. Run the image:
    docker run cr.$NB_REGION_ID.nebius.cloud/$NB_REGISTRY_PATH/hello-world:hello