安装Harbor

一、前提:安装dockers

安装docker

二、安装docker-compose

1、下载安装文件

curl -SL https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose

2、给文件赋执行权限

sudo chmod +x /usr/local/bin/docker-compose

3、软链接文件到user/bin下

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

4、验证安装

docker-compose --version

三、安装harbor

1、下载安装包

wget --no-check-certificate https://ghproxy.com/https://github.com/goharbor/harbor/releases/download/v1.10.14/harbor-offline-installer-v1.10.14.tgz

2、解压安装包及进入配置文件

tar xzvf harbor-offline-installer-v1.10.14.tgz
cd harbor
vim harbor.yml

3、修改配置文件

## 修改内容 : 
## 1、hostname 访问的ip或域名
## 2、prot 访问端口
## 3、这里将https模块屏蔽掉,就不做证书的一些操作了

# 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: 172.20.191.103

# http related config
http:
  # port for http, default is 80. If https enabled, this port will redirect to https port
  port: 8001

# 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

4、安装

./install.sh
# 检查安装
docker ps  #会看很多个关于harbor的镜像

5、添加刚才的harbor库到自己的docker

sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://t1gbabbr.mirror.aliyuncs.com"],
  "insecure-registries": ["172.20.191.103:8001"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

6、进入harbor界面

http://172.20.191.103:8001/
admin/Harbor12345

四、harbor关机、启动

#关掉
docker-compose -f /usr/local/harbor/docker-compose.yml down 
#开启
nohup docker-compose -f /usr/local/harbor/docker-compose.yml up &
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值