Examples of image transfer between harbor

Operating section

Now that you have installed two docker harbor and a client, and the host shown in the following table ip

Host computer ip Roles
host1 192.168.20.120 docker
host2 192.168.20.121 harbor1
host3 192.168.20.122 harbor2

Create a project kgc on harbor1
Here Insert Picture Description

Copy the target set in the harbor1
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

Create a copy rule on harbor1
Here Insert Picture Description
Here Insert Picture Description

Here Insert Picture Description

Now we go docker client configuration, landing harbor, and upload the image to the project kgc

[root@localhost ~]# vim /usr/lib/systemd/system/docker.service 
 14 ExecStart=/usr/bin/dockerd --insecure-registry 192.168.20.121
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart docker
[root@localhost ~]# docker login -u admin -p Harbor12345 192.168.20.121
WARNING! 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. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
[root@localhost ~]# docker tag centos 192.168.20.121/kgc/centos:latest
[root@localhost ~]# docker push 192.168.20.121/kgc/centos
The push refers to repository [192.168.20.121/kgc/centos]
d69483a6face: Pushed 
latest: digest: sha256:ca58fe458b8d94bc6e3072f1cfbd334855858e05e1fd633aa07cf7f82b048e66 size: 529

Check on whether to harbor1 image upload
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
can be seen from the figure, the mirrored copy harbor1 on harbor2, here we landed harbor2 view verification

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

Published 76 original articles · won praise 60 · views 20000 +

Guess you like

Origin blog.csdn.net/weixin_43557605/article/details/101102668