使用harbor安装部署docker私有仓库

下载安装程序

进入下载页面下载对应离线安装程序
image.png

wget https://github.com/goharbor/harbor/releases/download/v1.10.2/harbor-offline-installer-v1.10.2.tgz

解压压缩包

tar -xvf harbor-offline-installer-v1.10.2.tgz

编辑配置文件

编辑harbor.yml

# cd harbor
# ls
common.sh  harbor.v1.10.2.tar.gz  harbor.yml  install.sh  LICENSE  prepare
# 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: reg.yourdomain.com

# 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 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 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: 50
  # The maximum number of open connections to the database. If it <= 0, then there is no limit on the number of open connections.

修改hostname 为本机ip地址或网址,并禁用https相关选项

详细参数修改参考该网址

执行安装命令

运行安装命令./install.sh
等待执行完毕,浏览器访问配置ip。发现已经成功部署

默认账号密码:

admin
Harbor12345

本地Docker登录

在本地docker设置文件中添加harbor服务器ip地址
使用harbor安装部署docker私有仓库_第1张图片
将图片中的hostname替换为正确的ip地址即可

执行docker login hostname登录

你可能感兴趣的:(Docker)