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 lifecycle policies
      • Creating a lifecycle policy
      • Updating a lifecycle policy
      • Performing lifecycle policy dry runs
      • Deleting a lifecycle policy
    • 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 Docker image lifecycle policies
  3. Performing lifecycle policy dry runs

Testing a lifecycle policy

Written by
Yandex Cloud
Updated at March 6, 2025

A dry run helps verify which Docker images meet lifecycle policy rules. Docker images are not actually deleted during dry runs.

Warning

The maximum number of Docker images in a single repository that a single dry run can verify is 50,000. In this case, an active policy with the same rules deletes all Docker images that are suitable for deletion.

Management console
CLI
API
  1. In the management console, select the folder where the registry was created.
  2. In the list of services, select Container Registry.
  3. Select the registry and click the row with its name.
  4. Select the repository and click the row with its name.
  5. In the left-hand panel, click Lifecycle.
  6. Click the name of the lifecycle policy you need.
  7. In the top-right corner, click Dry run. Once the test is completed, the Lifecycle dru runs section will contain a line with the policy dry run results.
  8. To get a list of Docker images to be deleted according to the policy rules, click the line with the policy dry run results.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

To test a lifecycle policy:

  1. Perform a dry run of the policy:

    yc container repository lifecycle-policy dry-run <policy_ID>
    

    Result:

    dry_run_lifecycle_policy_result_id: crpn27glo1k8********
    lifecycle_policy_id: crp6lg1868p3********
    run_at: "2020-05-29T07:30:02.704Z"
    affected_images_count: "1"
    

    To find out the policy ID, get a list of lifecycle policies in a repository or registry.

  2. Get a list of policy dry runs:

    yc container repository lifecycle-policy list-dry-run-results crp6lg1868p3********
    

    Result:

    +----------------------+----------------------+-----------------------+---------------------+
    |      RESULT ID       | LIFECYCLE POLICY ID  | AFFECTED IMAGES COUNT |       RUN AT        |
    +----------------------+----------------------+-----------------------+---------------------+
    | crpn27glo1k8******** | crp6lg1868p3******** |                     1 | 2020-05-29 07:30:02 |
    +----------------------+----------------------+-----------------------+---------------------+
    
  3. Get information about the results of the policy dry run. Use the RESULT ID parameter from the previous item:

    yc container repository lifecycle-policy get-dry-run-result crpn27glo1k8********
    

    Result:

    dry_run_lifecycle_policy_result_id: crpn27glo1k8********
    lifecycle_policy_id: crp6lg1868p3********
    run_at: "2020-05-29T07:30:02.704Z"
    affected_images_count: "1"
    
  4. Get a list of Docker images to be deleted according to the policy rules. Use the dry_run_lifecycle_policy_result_id parameter from the previous item:

    yc container repository lifecycle-policy list-dry-run-affected-images crpn27glo1k8********
    

    Result:

    +----------------------+---------------------+-----------------------------+------+-----------------+
    |          ID          |       CREATED       |            NAME             | TAGS | COMPRESSED SIZE |
    +----------------------+---------------------+-----------------------------+------+-----------------+
    | crphc7nnrvhl******** | 2019-01-17 17:00:48 | crp2hlbs67tj********/ubuntu | 111  | 64.1 MB         |
    +----------------------+---------------------+-----------------------------+------+-----------------+
    

To test a lifecycle policy:

  1. Perform a policy dry run using the DryRun method of the LifecyclePolicyService resource. Specify the policy ID in the lifecycle_policy_id parameter. You can retrieve a list of policies using the List method for the LifecyclePolicyService resource.
  2. Retrieve a list of policy dry runs using the ListDryRunResults method for the LifecyclePolicyService resource. Specify the policy ID in the lifecycle_policy_id parameter.
  3. Retrieve information regarding a policy dry run using the GetDryRunResult method for the LifecyclePolicyService resource. In the dry_run_lifecycle_policy_result_id parameter, specify the ID of the policy dry run results from the previous item.
  4. Get a list of Docker images to be deleted according to the policy rules. Use the ListDryRunResultAffectedImages method for the LifecyclePolicyService resource. In the dry_run_lifecycle_policy_result_id parameter, specify the ID of the policy dry run results.

Was the article helpful?

Previous
Updating a lifecycle policy
Next
Deleting a lifecycle policy
© 2025 Direct Cursus Technology L.L.C.