All Products
Search
Document Center

Container Registry:Push and pull a custom OCI artifact

Last Updated:Apr 01, 2024

Container Registry Enterprise Edition allows you to manage custom Open Container Initiative (OCI) artifacts that are created on an OCI Registry As Storage (ORAS) client. Container Registry Enterprise Edition also provides secure management and efficient distribution services for custom OCI artifacts.

Prerequisites

  • An ORAS client is installed on your on-premises computer. For more information, see Installation.

  • A virtual private cloud (VPC) access control list (ACL) is configured or Internet access is enabled for the Container Registry Enterprise Edition instance. In this topic, Internet access is enabled. For more information, see Configure access over the Internet.

  • The password that is used to log on to the Container Registry Enterprise Edition instance is obtained.

    If you forget your password, you can reset the password by configuring access credentials. For more information, see Configure access credentials for a Container Registry Enterprise Edition instance.

Background information

Container Registry Enterprise Edition can host OCI artifacts, including images, Helm charts, and custom OCI artifacts. For more information, see Push an image to a Container Registry Enterprise Edition instance and pull an image from the instance and Push and pull Helm charts.

Push a custom OCI artifact to a Container Registry Enterprise Edition instance

  1. Run the following command to log on to the Enterprise Edition instance:

    oras login --username=<Username that is used to log on to the image repository> <Name of the enterprise Edition instance>-registry.cn-<Region of the Enterprise Edition instance>.cr.aliyuncs.com

    Follow the on-screen instructions to enter the logon password. If login succeeded is displayed, you have logged on to the Enterprise Edition instance.

  2. Run the following command to create an OCI artifact by using your on-premises data:

    echo "hello world" > artifact.txt
  3. Run the following command to push the OCI artifact to the Enterprise Edition instance:

    oras push mlf-registry.cn-hangzhou.cr.aliyuncs.com/<Namespace name>/<Name of the image repository>:<OCI artifact version> --manifest-config /dev/null:application/vnd.customized.artifact.config ./artifact.txt
    • manifest-config /dev/null:application/vnd.customized.artifact.config: specifies application/vnd.customized.artifact.config as the type of the artifact.

    • manifest-config /dev/null:application/vnd.customized.artifact.config ./artifact.txt: specifies artifact.txt as the on-premises data.

Pull the custom OCI artifact from the Container Registry Enterprise Edition instance

  1. Run the following command to log on to the Enterprise Edition instance:

    oras login --username=<Username that is used to log on to the image repository> <Name of the enterprise Edition instance>-registry.cn-<Region of the Enterprise Edition instance>.cr.aliyuncs.com

    Follow the on-screen instructions to enter the logon password. If login succeeded is displayed, you have logged on to the Enterprise Edition instance.

  2. Run the following command to pull the specified OCI artifact from the Enterprise Edition instance.

    oras pull <Name of the enterprise Edition instance>-registry.cn-<Region of the Enterprise Edition instance>.cr.aliyuncs.com/<Namespace name>/<Image repository name>:<OCI artifact version>
  3. Run the following command to check whether the OCI artifact is stored on your on-premises computer.

    cat <OCI artifact version>

    If the output contains OCI-related file content, the OCI artifact is stored on your on-premises computer.