[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@localhost ~]# yum -y install yum-utils device-mapper-persistent-data lvm2
[root@localhost ~]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
[root@localhost yum.repos.d]# yum -y install docker-ce
[root@localhost yum.repos.d]# systemctl start docker
客户端下载镜像
[root@localhost yum.repos.d]# docker pull hello-world
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest d1165f221234 13 days ago 13.3kB
服务端 拖包 安装harbor
[root@localhost ~]# systemctl start docker
[root@localhost ~]# tar -zxf harbor-offline-installer-v1.6.2.tgz -C /usr/local/
[root@localhost ~]# cd /usr/local/harbor/
[root@localhost harbor]# vim harbor.cfg
7 hostname = 192.168.2.20
[root@localhost harbor]# cd
[root@localhost ~]# mv docker-compose /usr/bin/
[root@localhost ~]# chmod +x /usr/bin/docker-compose
[root@localhost ~]# cd /usr/local/harbor/
[root@localhost harbor]# ./install.sh
[root@localhost harbor]# firefox 192.168.2.20
客户端
[root@localhost ~]# docker tag hello-world:latest 192.168.2.20/kgcweb/hello-world
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
192.168.2.20/kgcweb/hello-world latest d1165f221234 13 days ago 13.3kB
[root@localhost ~]# vim /usr/lib/systemd/system/docker.service
13 ExecStart=/usr/bin/dockerd --insecure-registry 192.168.2.20
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart docker
[root@localhost ~]# docker login -u admin -p Harbor12345 192.168.2.20
上传:
[root@localhost ~]# docker push 192.168.2.20/kgcweb/hello-world
Using default tag: latest
The push refers to repository [192.168.2.20/kgcweb/hello-world]
f22b99068db9: Pushed
latest: digest: sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 size: 525
下载:
[root@localhost ~]# docker rmi 192.168.2.20/kgcweb/hello-world:latest
Untagged: 192.168.2.20/kgcweb/hello-world:latest
Untagged: 192.168.2.20/kgcweb/hello-world@sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest d1165f221234 13 days ago 13.3kB
percona/pmm-server 1.17.1 deac61541b67 2 years ago 1.08GB
[root@localhost ~]# docker pull 192.168.2.20/kgcweb/hello-world
Using default tag: latest
latest: Pulling from kgcweb/hello-world
Digest: sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792
Status: Downloaded newer image for 192.168.2.20/kgcweb/hello-world:latest
192.168.2.20/kgcweb/hello-world:latest
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
192.168.2.20/kgcweb/hello-world latest d1165f221234 13 days ago 13.3kB
hello-world latest d1165f221234 13 days ago 13.3kB
percona/pmm-server 1.17.1 deac61541b67 2 years ago 1.08GB
harbor
harbor的主从
主 192.168.2.20
从 192.168.2.10
在这里我直接把客户端安装了从的harbor
主:
客户端
[root@localhost ~]# docker tag hello-world:latest 192.168.2.20/kgcweb/hello-world
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
192.168.2.20/kgcweb/hello-world latest d1165f221234 13 days ago 13.3kB
[root@localhost ~]# vim /usr/lib/systemd/system/docker.service
13 ExecStart=/usr/bin/dockerd --insecure-registry 192.168.2.20
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl restart docker
[root@localhost ~]# docker login -u admin -p Harbor12345 192.168.2.20
上传:
[root@localhost ~]# docker push 192.168.2.20/kgcweb/hello-world
Using default tag: latest
The push refers to repository [192.168.2.20/kgcweb/hello-world]
f22b99068db9: Pushed
latest: digest: sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792 size: 525
下载:
[root@localhost ~]# docker rmi 192.168.2.20/kgcweb/hello-world:latest
Untagged: 192.168.2.20/kgcweb/hello-world:latest
Untagged: 192.168.2.20/kgcweb/hello-world@sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest d1165f221234 13 days ago 13.3kB
percona/pmm-server 1.17.1 deac61541b67 2 years ago 1.08GB
[root@localhost ~]# docker pull 192.168.2.20/kgcweb/hello-world
Using default tag: latest
latest: Pulling from kgcweb/hello-world
Digest: sha256:1b26826f602946860c279fce658f31050cff2c596583af237d971f4629b57792
Status: Downloaded newer image for 192.168.2.20/kgcweb/hello-world:latest
192.168.2.20/kgcweb/hello-world:latest
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
192.168.2.20/kgcweb/hello-world latest d1165f221234 13 days ago 13.3kB
hello-world latest d1165f221234 13 days ago 13.3kB
percona/pmm-server 1.17.1 deac61541b67 2 years ago 1.08GB
harbor
harbor的主从
主 192.168.2.20
从 192.168.2.10
在这里我直接把客户端安装了从的harbor
主: