Docker ❉ Docker仓库Harbor详解

一 简介

        Harbor 是一个由 CNCF 托管的开源的 Docker 镜像仓库管理工具,我们可以通过它快速的建立起自己的私有仓库。 当然,搭建私有仓库的选择很多,如 Docker 官方提供的 registry 镜像或者 Nexus 等

二 安装

1 底层要求

Docker Compose下载URL:https://github.com/docker/compose/releases/

点击此处进行跳转下载

[root@localhost ~]# curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
[root@localhost ~]# chmod +x /usr/local/bin/docker-compose

检查部署底层要求版本是否符合

[root@localhost bin]# python --version
Python 3.8.0
# 加一条软链接以免报错
[root@localhost bin]# ln -s /usr/local/python3/bin/python3.8 /usr/bin/python3
[root@localhost bin]# python3 --version
Python 3.8.0
[root@localhost bin]# docker --version
Docker version 20.10.12, build e91ed57
[root@localhost bin]# docker-compose --version
docker-compose version 1.21.2, build a133471

2 安装Harbor

(1)获取文件

        Harbor下载URL:https://github.com/goharbor/harbor/releases
点击此处进行跳转下载

# 我用的自己的harbor包,需要进行一下校验
[root@192 ~]# md5sum harbor-offline-installer-v1.10.1.tgz 
e9ccca33e9a25b6b64425943c06f5fe6  harbor-offline-installer-v1.10.1.tgz


# 解压缩以后会出现一个harbor文件夹
[root@192 ~]# tar -zxf harbor-offline-installer-v1.10.1.tgz
[root@192 ~]# ll
total 658288
~~~
drwxr-xr-x  2 root root       118 Dec 25 03:44 harbor
-rw-r--r--  1 root root 674078519 Dec 25 03:43 harbor-offline-installer-v1.10.1.tgz
~~~

(2)修改Harbor配置文件

[root@192 cert]# cd /root/harbor/
[root@192 harbor]# ll
total 662120
-rw-r--r-- 1 root root      3398 Feb 10  2020 common.sh
-rw-r--r-- 1 root root 677974489 Feb 10  2020 harbor.v1.10.1.tar.gz
-rw-r--r-- 1 root root      5882 Feb 10  2020 harbor.yml
-rwxr-xr-x 1 root root      2284 Feb 10  2020 install.sh
-rw-r--r-- 1 root root     11347 Feb 10  2020 LICENSE
-rwxr-xr-x 1 root root      1749 Feb 10  2020 prepare
# 这里有个harbor.yml


Harbor配置文件参数详解(重点) 

[root@localhost harbor]# vim harbor.yml
# Configuration file of Harbor
# Harbor的配置文件

# The IP address or hostname to access admin UI and registry service.
# 配置访问管理UI和注册表服务的IP地址或主机名
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
# 不要使用localhost或127.0.0.1,因为Harbor需要被外部客户端访问
hostname: 192.168.247.132  # 虚拟机IP

-----------------------------------------------------------------------
# http related config
# http相关配置
http:
  # port for http, default is 80. If https enabled, this port will redirect to https port
  # 若https端口开启,此端口重定向至https端口
  port: 80

-----------------------------------------------------------------------
## https related config  # 我选择注释掉,否则会报错
## https相关
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值