Updated on 2025-04-08 GMT+08:00

Image Repositories

Can I Export or Pull Public Images?

You cannot export or pull images uploaded by other users.

  • To pull official images, run the corresponding container command. For example, to pull the Nginx image, run the following command:

    docker pull nginx

  • To pull the images that you have pushed to SWR, take the following steps:
    1. Log in to the SWR console.
    2. In the navigation pane, choose My Images. Click the image to be pulled. The image details page is displayed.
    3. Click the Pull/Push tab, and run the docker pull command to pull the desired image as prompted.

How Do I Create a Container Image?

You can use Dockerfile to create a container image for a simple web workload. After you create a containerized workload using an official Nginx image, the default Nginx welcome page is displayed. The following describes how to create an image to change the default welcome message to "Hello, CCI!"

  1. Log in to the VM running Docker as root.
  2. Create a file named Dockerfile.

    mkdir mynginx

    cd mynginx

    touch Dockerfile

  3. Edit the Dockerfile file.

    vi Dockerfile

    Example file content:

    FROM nginx
    RUN echo '<h1>Hello,CCI!</h1>' > /usr/share/nginx/html/index.html

    Where,

    • FROM statement: specifies that an Nginx image is used as a base image.
    • RUN statement: indicates that the echo command is executed to display "Hello, CCI!"

  4. Build a container image.

    docker build -t nginx:v3 .

  5. Check the created image. The command output shows that the image has been created with a tag of v3.

    docker images

How Do I Push Images to SWR?

There are two methods to push images to SWR:

Does CCI Provide Base Container Images?

CCI's image repository is provided by SWR, which provides base container images.

Does CCI Administrator Have the Permission to Push Image Packages?

To push images for CCI, you need to use SWR.

You also need to add the swr:repo:upload permission for the account.

What Permissions Are Required for Pushing Image Packages for CCI?

To push images for CCI, you need to use SWR.

You need the swr:repo:upload permission. For details, see SWR permissions.

For details about how to push an image, see Uploading an Image Through a Container Engine Client or Uploading an Image Through SWR Console.

What Do I Do If Authentication Is Required During Image Push?

To push images for CCI, you need to use SWR.

To push images to SWR, you need the permission to access SWR. For details about how to push images, see Uploading an Image Through a Container Engine Client.

Figure 1 Pushing images

Is There a Way for CCI to Avoid Image Pull During Workload Startup?

CCI provides image snapshots. You can create an image snapshot using the image to be used, so that the image is not pulled when the workload is started. For details, see Image Snapshots.