docker 搭建私有仓库 harbor
前提 已安装好 docker 和 docker-compose
环境:CentOS Linux release 7.5
docker 版本:18.09.05
1.安装harbor
wget -P /usr/loca/src/ https://github.com/vmware/harbor/releases/download/v1.2.0/harbor-online-installer-v1.2.0.tgz
2.解压
cd /usr/local/src/ tar zxf /usr/loca/src/harbor-online-installer-v1.2.0.tgz -C /usr/local/ cd /usr/local/harbor/
3.编辑配置
vim /usr/local/harbor/harbor.cfg
# vim /usr/local/harbor/harbor.cfg hostname = 192.168.1.220 #邮箱配置 email_server = smtp.qq.com email_server_port = 25 email_username = 937869175@qq.com email_password =12345678 email_from = UnixFBI <937869175@qq.com> email_ssl = false #禁止用户注册 self_registration = off #设置只有管理员可以创建项目 project_creation_restriction = adminonly
4.执行脚本
/usr/local/harbor/install.sh
5.启动,停止,重启
#进入目录 cd /usr/local/harbor/ #启动 docker-compose start #停止 docker-compose stop #重启 docker-compose restart
6.浏览器打开 192.168.1.220(因为hostname 我这是为这个地址,此为安装harbor的服务器地址)
效果图
初始化账号密码:admin / Harbor12345
7.尝试登陆
docker login 192.168.1.220
username:admin
password:Harbor12345
出现问题: Error response from daemon: Get https://192.168.1.220/v2/: dial tcp 192.168.1.220:443: connectex: No connection could be made because the target machine actively refused it.
解决方案:
centos安装harbor的服务器修改:
编辑
vi /usr/lib/systemd/system/docker.service
#修改这行
ExecStart=/usr/bin/dockerd --insecure-registry 192.168.1.220
重启:
systemctl daemon-reload
systemctl restart docker
或者windows客户端修改:
此随笔乃本人学习记录,如有疑问欢迎在下面评论,转载请标明出处。
如果对您有帮助请动动鼠标右下方给我来个赞,您的支持是我最大的动力。