Updated on 2024-01-26 GMT+08:00

Migrating Images

Migrate the images stored in the image repository of CCE 1.0 to CCE 2.0.

This section takes the Apache image as an example to show how to migrate images step by step.

Procedure

Before pushing container images, ensure that the local Docker client can access your private container registry.

  1. Log in to the Docker client as the root user.
  2. Create an organization. Organizations are used to isolate images and assign access permissions (read, edit, and manage) to different users.

    1. Log in to the CCE console. In the navigation pane, choose Image Repository.
    2. On the Image Repository dashboard page, click Create Organization.
    3. Enter an organization name, that is, the domain name. When the configuration is complete, click OK.

  3. Log in to the Docker client as the root user.
  4. Pull the images stored in the image repository of CCE 1.0 to a local directory.

    To pull images, log in to the CCE 1.0 console. In the navigation pane, choose Image Repository. Click the name of the target images. On the image details pages, you can find corresponding image pull command.

    Example:

    docker pull 10.154.57.150:443/test/apache-php:latest

  5. Connect to CCE 2.0.

    1. Log in to the CCE 2.0 console. In the navigation pane, click Image Repository.
    2. On the page displayed, click Upload Through Docker Client. Click Generate a temporary Docker login command.
    3. Click to copy the command.

  1. Log in to the server where Docker is installed. Run the Docker login command copied in 5.

    After you log in to the Docker client, the system displays the message "login succeeded".

  2. Run the following command to tag the nginx:1.10 image:

    docker tag {imageid} {image address}:tag

    {image address} is the image repository address. If you push an image from an external network, enter the external image address. If you push an image from an internal network, enter the internal image address.

    Example:

    docker tag 2e233ad9329b 10.125.1.15:20202/test/apache-php:latest

  3. Run the following command to push the image to the image repository:

    docker push {image address}:tag

    Example:

    docker push 10.125.1.15:20202/test/apache-php:latest

    If the following information is displayed, the push is successful:

    6d6b9812c8ae: Pushed 
    695da0025de6: Pushed 
    fe4c16cbf7a4: Pushed 
    1.10: digest: sha256:eb7e3bbd8e3040efa71d9c2cacfa12a8e39c6b2ccd15eac12bdc49e0b66cee63 size: 948

    On the SWR console, choose My Images. The pushed images are displayed in the image list.