Container Registry: quick start
- Create a registry.
- Generate a token.
- Authorize the Docker CLI.
- Download the image.
- Download the image.
Create a registry
-
В control panels go to Cloud platform → Container Registry.
-
Click Get started.
-
Enter the name of the registry. The registry name will be part of its URI:
cr.selcloud.ru/<registry>
Specify
<registry>
— registry name. -
Click Create.
Generate token
To customize access to registries, generate a token. You can select the token validity period, access rights, and registries to which the token gives access.
-
В control panels go to Cloud platform → Container Registry.
-
Open the tab Tokens.
-
Click Generate token.
-
Enter the name of the token.
-
Select access rights:
- read-only — downloading images and charts from the registry will be available;
- write and read — adding, downloading and deleting images and charts from the registry will be available.
-
Select the registry to which you want to grant access. If you grant access to all registries, the token will also be valid for new registries that you will create in this project.
-
Select the validity period of the token:
- 30 days;
- 60 days;
- 90 days;
- 1 year;
- indefinite.
-
Click Generate token.
-
Save the data for authorization with the token — copy username and password or download the token in format
.json
.
log in to the Docker CLI
To work with the Docker CLI, you need the token and authorization data you received in the previous step.
-
Open the CLI.
-
Authorize Docker:
docker login cr.selcloud.ru
-
Enter the username and password for the token you are using generated.
Download the image
-
Assign a tag to the image:
docker tag <image> cr.selcloud.ru/<registry>/<image>:<tag>
Specify:
<image>
— image name, can be viewed withdocker image list
;<registry>
— name of the registry where you want to load the image;<tag>
— Tag.
-
Load the image into the registry:
docker push cr.selcloud.ru/<registry>/<image>:<tag>
Download image
Download an image from the registry:
docker pull cr.selcloud.ru/<registry>/<image>:<tag>
Specify:
<registry>
— name of the registry from which you want to download the image;<image>
— image name, can be viewed withdocker image list
;<tag>
— Tag.