Backing up Docker images in Container Registry
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 CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the
yc config set folder-id <folder_ID>command. You can also set a different folder for any specific command using the--folder-nameor--folder-idparameter.yc container registry listResult:
+----------------------+-------------+----------------------+ | 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-registryWhere
registry-nameis 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:helloResult:
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 listResult:
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