Python 云计算 Harbor 镜像仓库
2021/11/20 17:12:24
本文主要是介绍Python 云计算 Harbor 镜像仓库,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
[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 云计算 Harbor 镜像仓库的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-12-24Python编程入门指南
- 2024-12-24Python编程基础入门
- 2024-12-24Python编程基础:变量与数据类型
- 2024-12-23使用python部署一个usdt合约,部署自己的usdt稳定币
- 2024-12-20Python编程入门指南
- 2024-12-20Python编程基础与进阶
- 2024-12-19Python基础编程教程
- 2024-12-19python 文件的后缀名是什么 怎么运行一个python文件?-icode9专业技术文章分享
- 2024-12-19使用python 把docx转为pdf文件有哪些方法?-icode9专业技术文章分享
- 2024-12-19python怎么更换换pip的源镜像?-icode9专业技术文章分享