Uploading an Image Through a Container Engine Client
This section walks you through the steps of uploading an image to SWR, namely, running commands in a container engine client to push an image to SWR, taking the 2048-demo:v1 image as an example.
Each image layer uploaded through the container engine client cannot exceed 10 GB.
Prerequisite
- You have created an organization in SWR. For details, see Creating an Organization.
- Your container engine client version must be 1.11.2 or later.
Procedure
- Access SWR.
- Log in to the SWR console.
- In the navigation pane, choose My Images and then click Upload Through Client. On the page displayed, click Generate a temporary login command and click
to copy the command. Then, record the domain name at the end of the login command. This is the address of the current image repository.
The login command obtained in this step is valid for 24 hours. For details about how to obtain a long-term valid login command, see Obtaining a Long-Term Valid Login Command. To learn the differences, see What Are the Differences Between Long-Term Valid Login Commands and Temporary Login Commands.
- Run the login command on your container engine client.
The message "login succeeded" will be displayed upon a successful login.
- Tag the 2048-demo image by running the following command:
docker tag [Image name:tag] [Image repository address]/[Organization name]/[Image name:tag]
Sample docker tag command:
docker tag 2048-demo:v1 swr.cn-north-1.myhuaweicloud.com/group/2048-demo:v1
In the sample command:
- swr.cn-north-1.myhuaweicloud.com is the address of SWR image repository.
- group indicates the organization name. When no existing organization matches this name, SWR automatically creates a new one with this name.
- 2048-demo:v1 indicates the image name and tag.
- Push the image to the image repository by running the following command:
docker push [Image repository address]/[Organization name]/[Image name:tag]
Sample docker push command:
docker push swr.cn-north-1.myhuaweicloud.com/group/2048-demo:v1
The following information will be returned upon a successful push:
6d6b9812c8ae: Pushed 695da0025de6: Pushed fe4c16cbf7a4: Pushed v1: digest: sha256:eb7e3bbd8e3040efa71d9c2cacfa12a8e39c6b2ccd15eac12bdc49e0b66cee63 size: 948
To view the pushed image, refresh the My Images page.
Last Article: Image Management
Next Article: Obtaining a Long-Term Valid Login Command
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.