Updated on 2025-09-19 GMT+08:00

Pushing an Image Artifact to an Image Repository

Scenarios

SWR allows you to push (or upload) local image artifacts to an SWR image repository through a container engine client for easier image artifact management.

Pushing an image through a container engine client is to run the docker or ctr commands on the server where the container engine is installed. If a Docker container engine client is used, run the docker push command. If a containerd container engine client is used, run the ctr push command.

You can push image artifacts over a private network or the public network. For details, see Configuring Network Access.

Prerequisites

Before using an image repository, ensure that:

  • You have created a namespace by following the instructions in Creating a Namespace.
  • You have prepared a container engine client, which can be used within the network access range defined in Access Control.

Constraints

  • If a Docker container engine client is used to push images, the Docker version is 18.06 or later.
  • If a containerd container engine client is used to push images, the containerd version is 1.5.0 or later.
  • The size of each image layer cannot exceed 10 GB.
  • A maximum of 160 images can be pushed to a repository of the Enterprise Edition concurrently.

Pushing an Image Using a Container Engine Client

You can refer to the following operations to push image using a Docker or containerd container engine client.

Docker

  1. Log in to the server where the container engine client is installed as user root.
  2. Obtain the temporary or long-term access credential by referring to Access Credentials and log in to the container engine client to access the image repository.

    The message Login Succeeded will be displayed upon a successful login.

    Temporary access credentials are valid for 24 hours after they are generated. Long-term credentials do not expire and can be used permanently.

  3. Tag the image.

    docker tag[image-name-1:tag-1] [repository-address]/[namespace-name]/[image-name-2:tag-2]

    In the command:

    • [image-name-1:tag-1]: name and tag of the image to be pushed.
    • [repository-address]: address for accessing the repository where the image is stored. To obtain the address, perform the following operations:

      Log in to the SWR console, switch to the target region in the upper left corner of the page, and choose Enterprise Edition in the navigation page. On the displayed page, click the name of the target repository to go to the repository details page. In the Basic Information area of the Dashboard page, obtain the access address.

    • [namespace-name]: namespace you created in Creating a Namespace.
    • [image-name-2:tag-2]: new name and tag for the image.
  4. Push the image to a repository.

    docker push [repository-address]/[namespace-name]/[image-name:tag-name]

  5. View the image artifact information in the image artifact list.

    After an image is pushed, you can use it to create a workload on the CCE console.