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.
Tutorials
    • All tutorials
    • Setting up a Managed Service for PostgreSQL connection from a container in Serverless Containers
    • Creating a VM from a Container Optimized Image
    • Creating a VM from a Container Optimized Image with an additional volume for a Docker container
    • Creating an instance group from a Container Optimized Image with multiple Docker containers
    • Creating an instance group from a Container Optimized Image
    • Creating a VM from a Container Optimized Image with multiple Docker containers
    • Updating a Container Optimized Image VM
    • Configuring data output from a Docker container to a serial port
  1. Container infrastructure
  2. Updating a Container Optimized Image VM

Updating a VM with a Container Optimized Image

Written by
Yandex Cloud
Updated at April 28, 2025

Change the Docker container settings on the VM created from a Container Optimized Image.

Management console
CLI
  1. In the management console, select the folder the VM was created in.
  2. In the list of services, select Compute Cloud.
  3. Click the row with the VM to update.
  4. Click Edit VM in the top panel.
  5. Change the parameters in the Docker container settings section.
  6. Click Save changes.
  1. View a description of the CLI command for updating VMs:

    yc compute instance update-container --help
    
  2. Get the unique ID of the VM. To do this, click the row with its name under Compute Cloud in the management console or use this CLI command:

    yc compute instance list
    

    Result:

    +----------------------+-------+-------------------+---------+----------------------------------+-------------+
    |          ID          | NAME  |      ZONE ID      | STATUS  |           EXTERNAL IP            | INTERNAL IP |
    +----------------------+-------+-------------------+---------+----------------------------------+-------------+
    | epdbf646ge5q******** | my-vm | ru-central1-b     | RUNNING | 84.201.155.117                   | 172.18.0.21 |
    +----------------------+-------+-------------------+---------+----------------------------------+-------------+
    
  3. Update the VM.

    Depending on how the VM was created, there are several ways to update it:

    Creation method Update using
    --container-image
    Update using
    --docker-compose-file
    Using the --container-* parameters The old Docker container is deleted and a new one is created. The old Docker container is deleted and new Docker containers are created (described in the docker-compose.yaml file).
    Using the docker-compose.yaml file specification The old Docker containers (described in docker-compose.yaml) are deleted and a new Docker container is created, described with the help of the --container-* parameters. Only new Docker containers (those added to the docker-compose.yaml file) or modified Docker containers are created. The Docker containers missing from the new docker-compose.yaml file are deleted.
    • Update the VM by setting new parameters:

      yc compute instance update-container epdbf646ge5q******** \
        --container-name=my_vm_new_version \
        --container-image=cr.yandex/mirror/ubuntu:18.04 \
        --container-env=KEY1=VAL1,KEY2=VAL2 \
        --remove-container-env=KEY3 \
        --container-stdin=false \
        --container-restart-policy=Never
      

      Where:

      • --container-name: Docker container name.
      • --container-image: Name of the Docker image used to run the Docker container.
      • --container-env: Environment variables available in the Docker container.
      • --remove-container-env: Exclude the environment variables whose keys are specified in the parameter.
      • --container-command: Command to run when you start the Docker container.
      • --container-stdin: Allocate the buffer for the input stream while running the Docker container.
      • --container-restart-policy: Parameters for the command specified in --container-command.
      • --container-privileged: Run the Docker container in privileged mode.

      Result:

      done (2s)
      id: epdbf646ge5q********
      folder_id: b1g88tflru0e********
      created_at: "2023-03-13T09:44:03Z"
      name: my-vm
      ...
      
    • Update the VM by setting the specifications of multiple Docker containers:

      yc compute instance update-container epdbf646ge5q******** --docker-compose-file=<path_to_file>
      

      Where --docker-compose-file is the path to the file with the Docker container specification.

      Result:

      done (2s)
      id: fhma9omhj2e7********
      folder_id: b1g88tflru0e********
      created_at: "2023-03-13T17:08:48Z"
      name: coi-vm
      ...
      

Was the article helpful?

Previous
Creating a VM from a Container Optimized Image with multiple Docker containers
Next
Configuring data output from a Docker container to a serial port
© 2025 Direct Cursus Technology L.L.C.