本文介绍用harbor 搭建 私有registry(离线环境下)
1.安装docker ,本搭建过程安装的docker版本是 Docker version 19.03.12
2.安装python
Python应该是2.7或更高版本
3.安装docker-compose
离线安装docker-compose很简单,作者将提前下载好的docker-compose文件的链接放出来。
链接:https://pan.baidu.com/s/19NfuPnIPcKJKxD9gsp1O-A
提取码:m9z8
将下载的文件复制粘贴到/usr/local/bin
chmod +x /usr/local/bin/docker-compose
4.离线安装harbor
harbor官网下载地址是 https://github.com/goharbor/harbor/releases#start-of-content
同样,harbor 安装文件的百度网盘链接地址
链接:https://pan.baidu.com/s/13PTrgsdksF0fWeDvLODjdg
提取码:uzz3
将下载的文件上传到主机,解压
tar xf harbor-offline-installer-v1.2.0.tgz mv harbor /usr/local/
修改配置文件 harbor.cfg
cd /usr/local/harbor/
值得注意的是:如果直接以ip访问harbor,harbor.cfg只需要修改下面的一处配置即可
hostname 后面直接填写主机ip即可。
执行安装脚本
./install.sh
安装完成后,harbor 相关容器自动启动
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
40f909937d00 vmware/nginx-photon:1.11.13 "nginx -g 'daemon of…" About an hour ago Up 54 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:4443->4443/tcp nginx
30d0c7fb2854 vmware/harbor-jobservice:v1.2.0 "/harbor/harbor_jobs…" About an hour ago Up 55 minutes harbor-jobservice
4541e7c95f37 vmware/harbor-ui:v1.2.0 "/harbor/harbor_ui" About an hour ago Up 54 minutes harbor-ui
0c5a3dc31838 vmware/harbor-db:v1.2.0 "docker-entrypoint.s…" About an hour ago Up 56 minutes 3306/tcp harbor-db
543df65ce8c7 vmware/harbor-adminserver:v1.2.0 "/harbor/harbor_admi…" About an hour ago Up 54 minutes harbor-adminserver
6516cdd5eabf vmware/registry:2.6.2-photon "/entrypoint.sh serv…" About an hour ago Up 55 minutes 5000/tcp registry
89f726ef9738 vmware/harbor-log:v1.2.0 "/bin/sh -c 'crond &…" About an hour ago Up 59 minutes 127.0.0.1:1514->514/tcp
本安装过程有一个小插曲,在localhost curl -i http://ip,返回的状态码是200,在远程主机chrome浏览器.无法打开网页,经过 重启docker,然后启动harbor的所有容器,输入admin账户,默认密码为 Harbor12345
事已至此,大功告成。