Updated on 2026-08-10 GMT+08:00

Uploading and Downloading a Docker Image on the Client

CodeArts Artifact can connect to local Docker clients. You may upload your private images from your local Docker client to self-hosted repos and share them with others, who can download these Docker images through their clients.

Docker Image

Docker artifacts refer to container images built and published using Docker. Docker images contain all dependencies and configurations required for running applications, ensuring portability and consistent behavior across environments.

Constraints

The repository password for a self-hosted repo is account-specific. If you are prompted for a password while using a different account, download the configuration file from the repository's Tutorial tab to obtain it.

Prerequisites

Uploading a Docker Image from the Client

  1. Access self-hosted repos using your Huawei Cloud account.
  2. Select the target Docker registry from the self-hosted repo page and click Tutorial on the right of the page.
  3. In the displayed dialog box, click Download Configuration File to download the config.json file.
  4. Obtain {username} and {password} from the downloaded file.

  5. Run the following command on your local client to log in to the Docker registry.

    docker login {url} -u ${username} -p ${password}

    Variables in the preceding command are as follows:

    • url: repository address.
    • username: {username} obtained in 4.
    • password: {password} obtained in 4.

  6. Load a local Docker image.

    docker load -i registry.k8s.io_pause.tar

  7. Query the name and version of a local Docker image.

    docker images

  8. Run the following command on your local client to package an image.

    docker tag ${image_name1}:${image_version1} {url}/${image_name2}:${image_version2}

    Variables in the preceding command are as follows:

    • image_name1: name of the local Docker image. This is the image name obtained in 7.
    • image_version1: version of the local Docker image. This is the image version number obtained in 7.
    • url: repository address, as shown in the following figure:

    • image_name2: You can name the uploaded image. The image name is displayed in the image list of the Docker registry.
    • image_version2: You can set the version of the uploaded image.

  9. Run the following command on the local client to upload the Docker image to the self-hosted repo.

    docker push {url}/${image_name}:${image_version}

    Variables in the preceding command are as follows:

    • url: repository address, as shown in the following figure:

    • image_name: Enter image_name2 in 8.
    • image_version: Enter image_version2 in 8.

  10. Check the uploaded image in the Docker registry.

Downloading a Docker Image to the Client

  1. Access self-hosted repos using your Huawei Cloud account.
  2. Select the target Docker registry on the self-hosted repo page.
  3. Click Tutorial on the right of the page.
  4. In the displayed dialog box, click Download Configuration File to download the config.json file.
  5. Obtain {username} and {password} from the downloaded file.
  6. Run the following command on your local client to log in to the Docker registry.

    docker login {url} -u ${username} -p ${password}

    Variables in the preceding command are as follows:

    • url: repository address.
    • username: {username} obtained in 4.
    • password: {password} obtained in 4.

  7. Run the following command on your local client to download the Docker image.

    docker pull {url}/${image_name}:${image_version}

    url: repository address, as shown in the following figure:

    • image_name: image name.
    • image_version: image version.