harbor实例间的镜像传输
操作部分
现在已经具备了两个安装好的harbor和一个docker客户端,主机及ip情况如下表所示
在harbor1上创建项目kgc
在harbor1上设置复制目标
在harbor1上创建复制规则
现在我们去客户端配置的docker、登陆harbor,并上传镜像到kgc项目
[[email protected] ~]# vim /usr/lib/systemd/system/docker.service 14 ExecStart=/usr/bin/dockerd --insecure-registry 192.168.20.121
[[email protected] ~]# systemctl daemon-reload
[[email protected] ~]# systemctl restart docker
[[email protected] ~]# docker login -u admin -p Harbor12345 192.168.20.121WARNING! Using --password via the CLI is insecure. Use --password-stdin.WARNING! Your password will be stored unencrypted in /root/.docker/config.json.Configure a credential helper to remove this warning. Seehttps://docs.docker.com/engine/reference/commandline/login/#credentials-storeLogin Succeeded
[[email protected] ~]# docker tag centos 192.168.20.121/kgc/centos:latest
[[email protected] ~]# docker push 192.168.20.121/kgc/centosThe push refers to repository [192.168.20.121/kgc/centos]d69483a6face: Pushed latest: digest: sha256:ca58fe458b8d94bc6e3072f1cfbd334855858e05e1fd633aa07cf7f82b048e66 size: 529