ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

Python 云计算 Harbor 镜像仓库

2021-11-20 15:01:47  阅读:186  来源: 互联网

标签:Python 192.168 Harbor world 镜像 2.20 root hello localhost


[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

主:

 

 

 

 

 

标签:Python,192.168,Harbor,world,镜像,2.20,root,hello,localhost
来源: https://blog.csdn.net/m0_60655253/article/details/121439469

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有