Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 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 a lifecycle policy dry run
      • 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 a lifecycle policy dry run

Testing a lifecycle policy

Written by
Yandex Cloud
Updated at August 3, 2026
View in Markdown

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

Warning

A dry run supports a maximum of 50,000 Docker images per repository. In this case, an active policy with the same rules will delete all Docker images eligible for deletion.

Management console
CLI
API
  1. In the management console, select the folder with the registry.
  2. Navigate to 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 lifecycle policy name.
  7. In the top-right corner, click Dry run. Once the test is complete, the Lifecycle dru runs section will contain a line with the policy dry run results.
  8. To get a list of Docker images to delete 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 the repository or registry.

  2. Get the 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 policy dry run results. Use RESULT ID from the previous step:

    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 delete according to the policy rules. Use dry_run_lifecycle_policy_result_id from the previous step:

    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 for the LifecyclePolicyService resource. Specify the policy ID in the lifecycle_policy_id parameter. You can get the list of policies using the List method for the LifecyclePolicyService resource.
  2. Get 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. Get 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 step.
  4. Get a list of Docker images to delete 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 result.

Was the article helpful?

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