Creating a registry
-
In the management console
, select the folder you want to create a registry in. -
In the list of services, select Cloud Registry.
-
In the left-hand panel, select
Registries. -
In the top-right corner, click Create registry.
-
Select the registry format.
-
Configure the registry format:
-
In the Registry type field, select the preferred registry type:
Local: Local registry. This type is available for all registry formats.Remote: Remote registry. This type is available for theMaven,Npm, andDockerformats.Virtual: Virtual registry. This type is available for theMaven,Npm, andDockerformats.
-
If you select
Mavenfor format andLocalfor type, select a version policy in the Version policy field:Release: For stable versions.Snapshot: For development with frequent updates.Mixed: A combination ofReleaseandSnapshotfor flexibility.
-
If you select
Remotefor type, select the remote registry's address:-
For
Maven, the available repositories areMaven CentralandAxiom.Note
You get access to
Axiomon request. To activate access toAxiom, create a request to support. -
For
Npm, you can only use theNpmrepository. -
For
Docker, you can only use theDocker Hubrepository. You have to specify authentication data forDocker Hub.-
Grant access to the contents of the Yandex Lockbox secret to the Cloud Registry service agent by assigning it the
lockbox.payloadViewerrole for this secret.Currently, you can only grant this access using the Yandex Cloud CLI command by specifying the ID of the Yandex Lockbox secret containing the token or password and the ID of the cloud you are creating the registry in:
yc lockbox secret add-access-binding \ --id <secret_ID> \ --role lockbox.payloadViewer \ --agent cloud-registry:data-plane \ --cloud-id <cloud_ID> -
Get authenticated in
Docker Hubusing an access token . For do this, select theBasicauthentication option, specify the username, and, in the Secret ID in Lockbox field, select the Yandex Lockbox secret whosevaluekey stores the token.
-
-
-
If you selected the
Virtualregistry type, use the Add registry button in the Registries field to add local and/or remote registries to the virtual registry by specifying their IDs.You can look up the registry ID in the management console on the registry info page.
-
-
Enter a name and description for the registry.
-
Click Create.
To create a registry, run this command:
yc cloud-registry registry create \
--name <registry_name> \
--description <registry_description> \
--registry-kind <registry_format> \
--registry-type <registry_type> \
--properties <registry_properties>
Where:
--name: Registry name.--description: Registry description.--registry-kind: Registry format. The available values aremaven,npm, anddocker.--registry-type: Registry type. The available values arelocal,remote, andvirtual.--properties: Registry properties. Provide them as a string inname1=value1,name2=value2format. Available properties:- For
localregistries:versionPolicy: Version policy for a registry inmavenformat. Possible values:mixed,release, andsnapshot. The default value ismixed.
- For
remoteregistries:source: Source registry. The possible values depend on the registry format, e.g.,@maven-centralformavenor@npmjsfornpm.authorizationType: Authorization type. Possible values:noneandbasic. The default value isnone. Available only for a registry indockerformat.authorizationSecretId: ID of the user secret that stores the token or password. It is required if theauthorizationTypeisbasic. Available only for a registry indockerformat.authorizationUsername: Username. It is required if theauthorizationTypeisbasic. Available only for a registry indockerformat.
- For
virtualregistries:registryIds: List of local and remote registry IDs in the order of their traversal. Provide inregistryIds=registry1;registry2format.readOnly: Permission to push artifacts to the registry. Possible values:trueto deny orfalseto allow pushing.deploymentRegistryId: ID of the registry to push artifacts to. It is required ifreadOnlyisfalse.
- For
Result:
done (3s)
id: cn1fsnc2dak********
folder_id: b1gc1t4cb638********
name: my-first-registry
kind: DOCKER
type: LOCAL
status: ACTIVE
description: docker
created_at: "2024-11-30T16:11:12.901356Z"
modified_at: "2024-11-30T16:11:16.243323Z"
To create a registry, use the create REST API method for the Registry resource or the RegistryService/Create gRPC API call.