Skip to main content

Migrate Docker Images to Container Registry

You can copy and synchronize Docker images to Container Registry Selectel using regsync.

regsync copies Docker images from one registry to another or keeps them synchronized on a schedule. You can transfer all repositories and tags to Container Registry Selectel if the source provider cannot replicate images to external registries. The source registry continues to work during this entire time with no downtime.

  1. Install regsync.

  2. Configure regsync.

  3. Transfer Docker images to Container Registry.

1. Install regsync

Install regsync. Follow the Installing instructions in the official regclient.org documentation.

You can run regsync as a binary file or in a Docker container.

2. Configure regsync

  1. Open the CLI.

  2. Open the regsync.yml file in a text editor.

  3. Set the Docker image transfer parameters. For a complete reference of parameters, see the Configuration File subsection of the regsync guide in the official documentation.

Example of transfer from Yandex Container Registry to Container Registry Selectel
creds:
- registry: cr.yandex
user: iam
pass: '<iam_token>'
- registry: cr.selcloud.ru
user: token
pass: '<selectel_token>'

defaults:
parallel: <images_number>
schedule: "<schedule>"

sync:
- source: cr.yandex/REGISTRY_ID/myapp
target: cr.selcloud.ru/my-registry/myapp
type: repository
fastCopy: true
- source: cr.yandex/REGISTRY_ID/devops/backup-tool
target: cr.selcloud.ru/my-registry/devops/backup-tool
type: repository
fastCopy: true
- source: cr.yandex/REGISTRY_ID/project/backend
target: cr.selcloud.ru/my-registry/project/backend
type: repository
fastCopy: true

Specify:

  • <iam_token> — IAM token of the Yandex Cloud user;
  • <selectel_token> — IAM token of the Selectel user. You can copy it in the control panel: in the top right corner, open the menu (account number) → Profile → Access section → IAM token tab → click Copy;
  • <images_number> — number of images to copy concurrently;
  • <schedule> — schedule for the server mode (cron). For example, 0 * * * * — once an hour. The schedule can be set separately for each source if needed.

3. Transfer Docker images

  1. Open the CLI.

  2. Specify the regsync operating mode:

    • regsync once - synchronizes all images once and exits;
    • regsync once --missing - copies only tags that are missing in the target registry. Suitable if tags are immutable or outdated content is not important;
    • regsync check - shows which images need to be synchronized, but does not copy anything;
    • regsync server - runs continuously: first copies all missing tags, then synchronizes on schedule.
  3. Check what needs to be copied:

    regsync check -c regsync.yml
  4. Perform the initial copy:

    regsync once -c regsync.yml
  5. If new images continue to arrive in the source registry before switching, enable scheduled synchronization:

    regsync server -c regsync.yml
  6. Switch CI/CD and application manifests to the image addresses in Container Registry Selectel.

  7. Perform a final synchronization and stop regsync.