一、SWR容器镜像服务介绍
华为云容器镜像服务(SoftWare Repository for Container)是一种支持容器镜像全生命周期管理的服务,提供简单易用、安全可靠的镜像管理功能,帮助用户快速部署容器化服务。

二、检查本地docker环境
1.检查docker版本
[root@node ~]# docker -v
Docker version 20.10.17, build 100c701
2.检查docker状态
[root@node ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2022-10-18 17:00:12 CST; 5h 16min ago
Docs: https://docs.docker.com
Main PID: 11773 (dockerd)
Tasks: 131
Memory: 849.9M
三、生成docker镜像压缩包
1.查看本地镜像列表
[root@node ~]# docker images |grep nginx
nginx 1.21 605c77e624dd 9 months ago 141MB
nginx latest 605c77e624dd 9 months ago 141MB
2.制作nginx的镜像压缩包
docker save nginx:1.21 > nginx.tar
3.查看压缩包
[root@node ~]# ls -sh nginx.tar
140M nginx.tar
四、登录华为云容器镜像服务

五、上传镜像到华为云SWR——页面上传
1.创建组织

2.页面上传容器镜像压缩包

3.查看上传容器镜像

4.其它容器客户端临时登录SWR

5.下载SWR镜像仓库中容器
[root@serer01 ~]# docker pull swr.cn-north-4.myhuaweicloud.com/jeven/nginx:1.21
1.21: Pulling from jeven/nginx
2edcec3590a4: Pull complete
e379e8aedd4d: Pull complete
b8d6e692a25e: Pull complete
f1db227348d0: Pull complete
32ce5f6a5106: Pull complete
d874fd2bc83b: Pull complete
Digest: sha256:9da0376dd8f43397dd7ee37e5333ac0f8e80d42fb5804e811e07eacdbbd95cc5
Status: Downloaded newer image for swr.cn-north-4.myhuaweicloud.com/jeven/nginx:1.21
swr.cn-north-4.myhuaweicloud.com/jeven/nginx:1.21
6.查看下载的容器镜像
[root@serer01 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx 1.21 0e901e68141f 4 months ago 142MB
swr.cn-north-4.myhuaweicloud.com/jeven/nginx 1.21 605c77e624dd 9 months ago 141MB
六、上传镜像到华为云SWR——客户端上传
1.临时登录SWR

2.重命名镜像
[root@serer01 ~]# docker tag busybox:1.28 swr.cn-north-4.myhuaweicloud.com/jeven/busybox:1.28
3.上传镜像到SWR
[root@serer01 ~]# docker push swr.cn-north-4.myhuaweicloud.com/jeven/busybox:1.28
The push refers to repository [swr.cn-north-4.myhuaweicloud.com/jeven/busybox]
432b65032b94: Pushed
1.28: digest: sha256:74f634b1bc1bd74535d5209589734efbd44a25f4e2dc96d78784576a3eb5b335 size: 527
4.在华为云SWR上查看上传镜像

七、查看SWR镜像详细信息
1.查看镜像版本信息

2.查看SWR资源负载情况

3.查看SWR镜像中心
