harbor安装( 二 )

7、配置开机自启:
/usr/local/sbin/docker-compose -f /data/software/harbor/docker-compose.yml up -d

harbor安装

文章插图
 
8、设置权限
chmod +x /etc/rc.local /etc/rc.d/rc.local9、尝试登陆harbor
harbor安装

文章插图
 
10、命令行登陆
[root@zabbix 15:08:00/data/software/harbor]# docker login 172.17.0.100:5000Username: adminPassword:Login Succeeded[root@zabbix 15:08:57/data/software/harbor]# 三、测试上传和下载1、新建一个项目目录:
harbor安装

文章插图
 

harbor安装

文章插图
 

harbor安装

文章插图
 

harbor安装

文章插图
 
2、我以nginx为例进行推送到harbor上:
[root@zabbix 16:45:33/data/software/harbor]# docker image ls | grep nginxnginxlatest605c77e624dd2 months ago141MBgoharbor/nginx-photonv2.4.178aad8c8ef412 months ago45.7MB[root@zabbix 16:45:42/data/software/harbor]# docker tag nginx:latest 172.17.0.100:5000/test/nginx1.8:v1[root@zabbix 16:59:00/data/software/harbor]# docker image ls | grep nginx172.17.0.100:5000/test/nginx1.8v1605c77e624dd2 months ago141MBnginxlatest605c77e624dd2 months ago141MBgoharbor/nginx-photonv2.4.178aad8c8ef412 months ago45.7MB[root@zabbix 16:59:04/data/software/harbor]# docker push 172.17.0.100:5000/test/nginx1.8:v1 The push refers to repository [172.17.0.100:5000/test/nginx1.8]d874fd2bc83b: Pushed 32ce5f6a5106: Pushed f1db227348d0: Pushed b8d6e692a25e: Pushed e379e8aedd4d: Pushed 2edcec3590a4: Pushed v1: digest: sha256:ee89b00528ff4f02f2405e4ee221743ebc3f8e8dd0bfd5c4c20a2fa2aaa7ede3 size: 1570[root@zabbix 16:59:25/data/software/harbor]# 3、查看镜像仓库,可以看到多了一个镜像
harbor安装

文章插图
 
4、镜像拉取(镜像下载)
[root@zabbix 16:59:25/data/software/harbor]# docker image rm 172.17.0.100:5000/test/nginx1.8:v1 Untagged: 172.17.0.100:5000/test/nginx1.8:v1Untagged: 172.17.0.100:5000/test/nginx1.8@sha256:ee89b00528ff4f02f2405e4ee221743ebc3f8e8dd0bfd5c4c20a2fa2aaa7ede3 [root@zabbix 17:01:15/data/software/harbor]# docker image ls | grep nginxnginxlatest605c77e624dd2 months ago141MBgoharbor/nginx-photonv2.4.178aad8c8ef412 months ago45.7MB [root@zabbix 17:02:07/data/software/harbor]# docker pull 172.17.0.100:5000/test/nginx1.8:v1v1: Pulling from test/nginx1.8Digest: sha256:ee89b00528ff4f02f2405e4ee221743ebc3f8e8dd0bfd5c4c20a2fa2aaa7ede3Status: Downloaded newer image for 172.17.0.100:5000/test/nginx1.8:v1172.17.0.100:5000/test/nginx1.8:v1 [root@zabbix 17:02:12/data/software/harbor]# docker image ls | grep nginx172.17.0.100:5000/test/nginx1.8v1605c77e624dd2 months ago141MBnginxlatest605c77e624dd2 months ago141MBgoharbor/nginx-photonv2.4.178aad8c8ef412 months ago45.7MB[root@zabbix 17:02:16/data/software/harbor]# 至此,harbor部署完毕
知识补充:1、如果以后修改了harbor.yml文件,那么先停止使用docker-compose down,再去修改harbor.yml文件,重新启动部署 ./install.sh
2、正常启动harbor启动:
docker-compose up -d3、未修改配置文件,重启Harbor命令:docker-compose start | stop | restart
原文链接:
https://blog.csdn.net/moyuanbomo/article/details/123378825

【harbor安装】


推荐阅读