前言:
Harbor 是一个企业级的云原生容器镜像仓库,harbor给予docker一个更加安全、高效管理、和存储、镜像复制、用户管理容器及镜像的私有仓库。废话不多说,直接展示成果:
正文:
下载安装包(如果因网络问题无法下载安装包后面会提供网盘链接):
wget https://github.com/goharbor/harbor/releases/download/v2.6.1/harbor-offline-installer-v2.6.1.tgz
解压安装包:
tar -zxvf harbor-offline-installer-v2.10.0.tgz
进入解压好的文件:
cd harbor
拷贝一份配置文件:
cp harbor.yml.tmpl harbor.yml
修改文件内容(注释为中文地方需要执行):
vi harbor.yml
# Configuration file of Harbor
# The IP address or hostname to access admin UI and registry service.
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname: 10.24.2.10 #修改成自己的ip地址
# http related config
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: 80
# https related config
#https: #注释https
# https port for harbor, default is 443
# port: 443
# The path of cert and key files for nginx
#certificate: /your/certificate/path
#private_key: /your/private/key/path
# # Uncomment following will enable tls communication between all harbor components
# internal_tls:
# # set enabled to true means internal tls is enabled
# enabled: true
# # put your cert and key files on dir
# dir: /etc/harbor/tls/internal
# # enable strong ssl ciphers (default: false)
# strong_ssl_ciphers: false
# Uncomment external_url if you want to enable external proxy
# And when it enabled the hostname will no longer used
# external_url: https://reg.mydomain.com:8433
# The initial password of Harbor admin
# It only works in first time to install harbor
# Remember Change the admin password from UI after launching Harbor.
harbor_admin_password: Harbor12345 #有需要的话可以更改成自己想要设置的登录密码
# Harbor DB configuration
database:
# The password for the root user of Harbor DB. Change this before any production use.
password: root123
# The maximum number of connections in the idle connection pool. If it <=0, no idle connections are retained.
max_idle_conns: 100
# The maximum number of open connections to the database. If it <= 0, then there is no limit on the number of open connections.
# Note: the default number of connections is 1024 for postgres of harbor.
max_open_conns: 900
# The maximum amount of time a connection may be reused. Expired connections may be closed lazily before reuse. If it <= 0, connections are not closed due to a connection's age.
# The value is a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
conn_max_lifetime: 5m
# The maximum amount of time a connection may be idle. Expired connections may be closed lazily before reuse. If it <= 0, connections are not closed due to a connection's idle time.
@
"harbor.yml" 306L, 13760C
接下来查看自己的docker是否启动
systemctl status docker
如果没有启动直接启动,不然的话harbor无法启动
systemctl start docker
运行harbor文件夹内置的安装脚本:
. install.sh
成功样图:
结尾:
登录web界面方式:10.24.2.10:80 #也就是ip+端口号
登录账户:admin
登录密码:Harbor12345
harbor压缩包文件网盘链接: https://pan.baidu.com/s/1G0FPqj3LFzcwhGTHV-jhPQ?pwd=iy9k 提取码: iy9k