部署Harbor私有镜像仓库

官网文档:https://github.com/goharbor/harbor/blob/master/docs/installation_guide.md

部署步骤:

1.下载docker-compose:

curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose

2.下载harbor:

wget https://github.com/vmware/harbor/releases/download/v1.2.2/harbor-offline-installer-v1.2.2.tgz

3.解压缩文件,配置harbor.cfg文件

修改hostname为自己想要的域名
修改harbor_admin_password admin用户登录密码
修改db_password 数据库密码

详细参数请看:https://github.com/goharbor/harbor/blob/master/docs/installation_guide.md

4.执行install.sh等待完成即可

cd /root/harbor(工作目录)
sh install.sh

到工作目录(我这里是/root/harbor)下,执行docker-compose ps查看各组件状态
在这里插入图片描述
访问harbor.cfg里hostname指定的域名即可.
用户:admin
密码:自定义的
在这里插入图片描述


https方式访问:

openssl req -newkey rsa:2048 -nodes -sha256 -keyout certs/registry.com.key -x509 -days 365 -out certs/registry.com.crt

Generating a 2048 bit RSA private key
..............+++
............................................+++
writing new private key to 'certs/domain.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:CN 								#国家
State or Province Name (full name) [Some-State]:BeiJing				#省份
Locality Name (eg, city) []:shenyang								#地点
Organization Name (eg, company) [Internet Widgits Pty Ltd]:foo      #公司
Organizational Unit Name (eg, section) []:bar 						#组织
Common Name (e.g. server FQDN or YOUR name) []:registry.com
!!!(自定义的域名)
Email Address []:123@qq.com

配置完成后修改harbor.cfg文件

修改ui_url_protocol为https
修改证书位置:
ssl_cert = /root/harbor/cert/registry.com.crt
ssl_cert_key = /root/harbor/cert/registry.com.key
secretkey_path = /root/harbor/cert

修改完成后去工作目录,更新配置./prepare

然后执行docker-compose restart

https://域名,访问即可.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值