美文网首页
harbor 2.1.0离线安装

harbor 2.1.0离线安装

作者: 万州客 | 来源:发表于2020-10-26 22:43 被阅读0次

之前安装过harbor 1.12,所以,安装2.1.0,也就轻车熟路了。前提当然是先安装好docker及docker-compose哟~

一,下载

https://github.com/goharbor/harbor/releases/tag/v2.1.0

要是github上下载慢的话,我提供一个百度网盘:
链接:https://pan.baidu.com/s/1ir526Teht9-Q5IaREI3kug
提取码:yjih
复制这段内容后打开百度网盘手机App,操作更方便哦

二,解压

下载完成,上传服务器,解压。

drwxr-xr-x. 3 root root        20 Oct 26 22:33 common
-rw-r--r--. 1 root root      3361 Sep 16 10:48 common.sh
-rw-r--r--. 1 root root      5978 Oct 26 22:33 docker-compose.yml
-rw-r--r--. 1 root root 558317240 Sep 16 10:49 harbor.v2.1.0.tar.gz
-rw-r--r--. 1 root root      8136 Oct 26 22:33 harbor.yml
-rw-r--r--. 1 root root      8136 Sep 16 10:48 harbor.yml.tmpl
-rwxr-xr-x. 1 root root      2523 Sep 16 10:48 install.sh
-rw-r--r--. 1 root root     11347 Sep 16 10:48 LICENSE
-rwxr-xr-x. 1 root root      1881 Sep 16 10:48 prepare

三,调整配置

从harbor.yml.tmpl复制一个harbor.yml,然后修改前面几行,自定义Hostname,port,禁用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: 192.168.1.212

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

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

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

2020-10-26 22_40_01-212 - root@k3s-agent_~_software_harbor - Xshell 6 (Free for Home_School).png

四,安装并启动

./install.sh

[Step 0]: checking if docker is installed ...

Note: docker version: 19.03.13

[Step 1]: checking docker-compose is installed ...

Note: docker-compose version: 1.27.4

[Step 2]: loading Harbor images ...
Loaded image: goharbor/clair-adapter-photon:v2.1.0
Loaded image: goharbor/trivy-adapter-photon:v2.1.0
Loaded image: goharbor/harbor-registryctl:v2.1.0
Loaded image: goharbor/harbor-log:v2.1.0
Loaded image: goharbor/harbor-portal:v2.1.0
Loaded image: goharbor/harbor-db:v2.1.0
Loaded image: goharbor/nginx-photon:v2.1.0
Loaded image: goharbor/prepare:v2.1.0
Loaded image: goharbor/harbor-jobservice:v2.1.0
Loaded image: goharbor/redis-photon:v2.1.0
Loaded image: goharbor/registry-photon:v2.1.0
Loaded image: goharbor/notary-server-photon:v2.1.0
Loaded image: goharbor/notary-signer-photon:v2.1.0
Loaded image: goharbor/clair-photon:v2.1.0
Loaded image: goharbor/chartmuseum-photon:v2.1.0
Loaded image: goharbor/harbor-core:v2.1.0


[Step 3]: preparing environment ...

[Step 4]: preparing harbor configs ...
prepare base dir is set to /root/software/harbor
WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https
Generated configuration file: /config/portal/nginx.conf
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/registryctl/config.yml
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
loaded secret from file: /data/secret/keys/secretkey
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir



[Step 5]: starting Harbor ...
Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating redis         ... done
Creating harbor-portal ... done
Creating registry      ... done
Creating registryctl   ... done
Creating harbor-db     ... done
Creating harbor-core   ... done
Creating nginx             ... done
Creating harbor-jobservice ... done
✔ ----Harbor has been installed and started successfully.----

五,登陆

主题深浅随意~


2020-10-26 22_41_47-Harbor.png

六,其它命令

主要通过docker-compose管理的,所以通过docker-compose -h就可以了解harbor的日常启停命令。

七,更改管理员密码

新版的harbor 2.0版本加密方式采用sha256,网上找的其它1版本的更改不合适了。这里找了一个新版的方法,作个记录。
1,进入harbor的数据库容器
docker exec -it harbor-db /bin/bash
2,进入postgres命令行

psql -h postgresql -d postgres -U postgres  #这要输入默认密码:root123 。
psql -U postgres -d postgres -h 127.0.0.1 -p 5432  #或者用这个可以不输入密码。

3,切换到harbor所在的数据库
\c registry
4,查看harbor_user表
select * from harbor_user;
5,重置admin用户密码为Harbor12345
update harbor_user set password='c999cbeae74a90282c8fa7c48894fb00', salt='nmgxu7a5ozddr0z6ov4k4f7dgnpbvqky' where username='admin';
6,退出

\q     退出postgresql
exit  退出容器

7,接下来,就可以通过WEBUI登陆admin(admin/Harbor12345)用户,进行密码更新了。

相关文章

  • harbor 2.1.0离线安装

    之前安装过harbor 1.12,所以,安装2.1.0,也就轻车熟路了。前提当然是先安装好docker及docke...

  • docker离线安装harbor

    ps:安装Harbor需要docker环境,配置https需要openssl 1 获取Harbor离线安装包 通过...

  • Harbor部署

    一、Docker-compose部署 二、Harbor部署 1、下载Harbor安装文件 选择离线安装,下载off...

  • 环境搭建-CentOS下安装Harbor镜像仓库

      harbor的官方安装指南介绍了harbor有三种安装方式,分别是在线安装、离线安装和OVA安装,由于网络环境...

  • 安装harbor

    前言 本文介绍如何安装harbor 操作步骤 下载离线安装包: https://storage.googleapi...

  • harbor容器私库搭建

    下载离线安装包 harbor-offline-installer-v1.10.2.tgz 安装 解压:tar xz...

  • Harbor私有仓库搭建

    简介 安装方式 1、Harbor离线安装包,github地址为: https://github.com/goha...

  • Harbor

    离线安装包 SSL证书 CA私钥 Server证书私钥openssl genrsa -out harbor-tes...

  • Vmware的容器仓库harbor

    准备 Harbor离线包(速度快) Docker-compose 证书,如果使用https 开始 安装Docker...

  • harbor2.0私有仓库搭建和使用

    一、 仓库搭建 1. 下载harbor离线安装包 https://github.com/goharbor/harb...

网友评论

      本文标题:harbor 2.1.0离线安装

      本文链接:https://www.haomeiwen.com/subject/onnzmktx.html