SWR 容器镜像服务
SoftWare Repository for Container (SWR) allows you to easily manage the full lifecycle of container images and facilitates secure deployment of images for your applications.
There are three ways to upload an image.
- Through the GUI interface of the SWR service
- Generate a templorary login command and upload
- Obtaining a Long-Term Valid Login Command
Method 1
We can save a docker image use docker save command, and then we can upload this tar file to SWR.
[root@ecs-c5e5 ~]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEhello-world latest 9c7a54a9a43c 3 months ago 13.3kB[root@ecs-c5e5 ~]# docker save hello-world:latest > hello-world.tar
Method 2
The provisional certification is only valid for a few hours.

Method 3
Login the huaweicloud account > Identity and Access Management > Users > Security Settings > Access Keys > Create Access key
# Use this command, you will get a Long-Term Valid Login keyprintf "AK" | openssl dgst -binary -sha256 -hmac "SK" | od -An -vtx1 | sed 's/[ \n]//g' | sed 'N;s/\n//'
# Usage Exampleprintf "RVHVMX******" | openssl dgst -binary -sha256 -hmac "H3nPwzgZ******" | od -An -vtx1 | sed 's/[ \n]//g' | sed 'N;s/\n//'docker login -u ap-southeast-3@RVHVMX****** -p cab4ceab4a1545*************** swr.ap-southeast-3.myhuaweicloud.comObtaining a Long-Term Valid Login Command
Show a Demo
Section titled “Show a Demo”Install Docker
Section titled “Install Docker”yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
yum install -y yum-utilsyum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
systemctl start docker && systemctl enable dockerGenerate a long-term password
Section titled “Generate a long-term password”Get the long-term password and login,then we can download image or build image push to SWR

Modify the tag and push the image

We can login the huaweicloud conosle for check
