Backing up Docker images in Container Registry
Written by
Updated at September 23, 2024
Data in Container Registry is stored securely and replicated in the Yandex Cloud infrastructure. However, you can create backups of Docker images at any time.
To back up your Docker images:
-
View the list of available registries:
Management consoleCLIAPI- In the management console
, select the folder where you want to view the list of registries. - Select Container Registry.
- You can see a list of registries on the Registries tab.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the
--folder-name
or--folder-id
parameter.yc container registry list
Result:
+----------------------+-------------+----------------------+ | ID | NAME | FOLDER ID | +----------------------+-------------+----------------------+ | crp1abc2tl3d******** | my-registry | b1g23ga82bcv******** | +----------------------+-------------+----------------------+
- In the management console
-
Get information about Docker images in each registry:
Management consoleCLIAPI- In the management console
, select the folder where you want to view information about Docker images. - Select Container Registry.
- On the Registries tab, click the name of the registry.
- On the Repositories page, click the name of the repository.
- On the Docker images page you can see the Docker images.
yc container image list --registry-name my-registry
Where
registry-name
is the registry name.Result:
+----------------------+---------------------+-----------------------------+-------+-----------------+ | ID | CREATED | NAME | TAGS | COMPRESSED SIZE | +----------------------+---------------------+-----------------------------+-------+-----------------+ | crpabcpg1pde******** | 2020-10-26 15:45:39 | crp1abc2tl3d********/ubuntu | hello | 27.2 MB | +----------------------+---------------------+-----------------------------+-------+-----------------+
- In the management console
-
Download the Docker images you want from each registry using their full address,
cr.yandex/<name>:<tag>
:CLIdocker pull cr.yandex/<registry_ID>/ubuntu:hello
Result:
hello: Pulling from crp1abc2tl3d********/ubuntu Digest: sha256:1d2b339619babc2d008eca2d5293e3c43ff84cbee597ff76dd3e7f7d******** Status: Downloaded newer image for cr.yandex/crp1abc2tl3d********/ubuntu:hello cr.yandex/crp1abc2tl3d********/ubuntu:hello
-
Make sure the Docker image has been pulled:
CLIdocker image list
Result:
REPOSITORY TAG IMAGE ID CREATED SIZE cr.yandex /crp1abc2tl3d********/ubuntu hello d12e******** 3 days ago 72.9MB ubuntu latest d12e******** 3 days ago 72.9MB