ubuntu安装harbor 2.8.1 仅开启http
时间: 2024-05-17 22:19:13 浏览: 138
0624-极智开发-解读ubuntu搭建harbor的方法
要在Ubuntu上安装Harbor 2.8.1并仅开启HTTP支持,可以按照以下步骤进行操作:
1. 安装Docker和Docker Compose。
```
$ sudo apt update
$ sudo apt install docker.io docker-compose
```
2. 下载Harbor 2.8.1的离线安装包。
```
$ wget https://github.com/goharbor/harbor/releases/download/v2.8.1/harbor-offline-installer-v2.8.1.tgz
```
3. 解压缩安装包。
```
$ tar xvf harbor-offline-installer-v2.8.1.tgz
```
4. 编辑Harbor配置文件`harbor.yml`,将`https`的值改为`false`,表示仅使用HTTP。
```
# 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: your.harbor.domain
# http related config
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: 80
# The http secret is used to provide protection for some features such as webhook.
# It should be a random string (a string of at least 12 characters, which contains letters, numbers, and special characters).
secret: your-secret
# 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
# Uncomment the following lines if you want to enable https
# https:
# port: 443
# # The path of cert and key files for nginx
# certificate: /your/certificate/path
# private_key: /your/private/key/path
```
5. 执行安装脚本。
```
$ cd harbor
$ sudo ./install.sh --with-notary --with-clair --with-trivy
```
如果您只想安装Harbor核心组件而不安装其他组件,则可以省略`--with-notary`、`--with-clair`和`--with-trivy`选项。
6. 安装完成后,使用以下命令启动Harbor服务:
```
$ sudo docker-compose up -d
```
这将启动Harbor服务并在后台运行。
现在,您可以通过浏览器访问http://your.harbor.domain来访问Harbor管理界面,并使用默认用户名和密码(admin/Harbor12345)进行登录。
阅读全文