Creating a Repository
Find out how to create a repository in Container Registry.
After you create a repository, you can push an image to it using the Docker CLI (see Pushing Images Using the Docker CLI). Any images that you subsequently push to the registry that include the same repository name are grouped into that repository.
Creating a repository before pushing an image is the usual workflow, but it's not always necessary. If you're not authorized to manage repositories in the tenancy's root compartment, you must always push an image to an existing repository. However, if you are authorized to push images to the tenancy's root compartment and you intend to do so, an existing repository is not necessary.
When you push an image, you normally use a command in the format docker push <registry-domain>/<tenancy-namespace>/<repo-name>:<version>
. However, if you select the Create repository on first push in root compartment option and push an image with a command that includes the name of a repository that doesn't already exist, a new private repository is created automatically in the root compartment.
For example, if you enter the command docker push ocir.us-ashburn-1.oci.oraclecloud.com/ansh81vru1zp/project02/acme-web-app:7.5.2
and the project02/acme-web-app
repository doesn't exist, a private repository called project02/acme-web-app
is created automatically in the root compartment.
You must belong to the tenancy's Administrators group or have been granted the REPOSITORY_MANAGE permission on the tenancy to automatically create the private repository in the tenancy's root compartment. See Policies to Control Repository Access.
Use the oci artifacts container repository create command and required parameters to create a repository:
oci artifacts container repository create --display-name <repo-name> --compartment-id <compartment_ocid> [OPTIONS]
For example:
oci artifacts container repository create --display-name project01/acme-web-app --compartment-id ocid1.compartment.oc1..aaaaaaaarvdfa72n...
For a complete list of flags and variable options for CLI commands, see the Command Line Reference.
Run the CreateContainerRepository operation to create a repository.