Docker 私有仓库Harbor配置安装(一)
技术积累 Centos7 Docker Harbor

企业级私有 Registry 服务器,Harbor 提供了更好的性能和安全。提升用户使用 Registry 构建和运行环境传输镜像的效率。Harbor 支持安装在多个 Registry 节点的镜像资源复制,镜像全部保存在私有 Registry 中, 确保数据和知识产权在公司内部网络中管控。另外,Harbor 也提供了高级的安全特性,诸如用户管理,访问控制和活动审计等。

比如企业内部的代码镜像仓库肯定是不对外的,就需要私有的镜像仓库来管理

开始安装(这里使用v2.0.1版本)

1、安装docker: 参考centos7 安装docker-ce文章

2、下载docker-compose

curl -L https://get.daocloud.io/docker/compose/releases/download/v1.25.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

3、下载Harbor离线安装包(用迅雷下载会快点)

wget https://github.com/goharbor/harbor/releases/download/v2.0.1/harbor-offline-installer-v2.0.1.tgz

4、解压,修改配置,执行安装

# 解压
tar xf harbor-offline-installer-v2.0.1.tgz
cd harbor

# 复制配置文件
cp harbor.yml.tmpl harbor.yml

#修改配置文件(如果不用https就注释掉https的几项,我是用的http就注释掉了https的,其他几项修改为自己的信息)
···
hostname: 192.168.16.215
···
# 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
····
harbor_admin_password: Harbor12345
···
data_volume: /data
···

Docker 私有仓库Harbor配置安装(一)


5、执行安装

# 执行install.sh脚本
./install.sh 

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

Note: docker version: 19.03.12

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

Note: docker-compose version: 1.25.2

[Step 2]: loading Harbor images ...

······
······

[Step 3]: preparing environment ...

[Step 4]: preparing harbor configs ...
prepare base dir is set to /root/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/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
Generated and saved secret to file: /data/secret/keys/secretkey
Successfully called func: create_root_cert
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 registryctl   ... done
Creating redis         ... done
Creating harbor-portal ... done
Creating registry      ... done
Creating harbor-db     ... done
Creating harbor-core   ... done
Creating harbor-jobservice ... done
Creating nginx             ... done
✔ ----Harbor has been installed and started successfully.----

6、登录web控制台 http://192.168.16.215

Docker 私有仓库Harbor配置安装(一)

Docker 私有仓库Harbor配置安装(一)


本文最后记录时间 2024-03-30
文章链接地址:
https://me.jinchuang.org/archives/652.html
本站文章除注明[转载|引用|来源],均为本站原创内容,转载前请注明出处
Docker容器添加host
Docker 设置网络代理
Docker build报错 DeadlineExceeded: failed to fetch oauth token: Post "https://auth.docker.io/token"
yum安装出现error: %pre() scriptlet failed, exit status 1, Error in PREIN scriptlet in rpm package 错误

Docker 私有仓库Harbor推拉镜像(二)

Windows CMD命令行使用curl gawk sed grep命令

留言

顶部