靳闯博客 记录是一种习惯,分享是一种态度
  • 波浪
  • 波浪
  • 波浪
  • 波浪
Docker 私有仓库Harbor配置安装(一)
发表于: | 分类: 技术积累 | 标签: Centos7 Docker Harbor | 评论:0 | 阅读: 232

企业级私有 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
chmox +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
···

harbor.png


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

harbor1.png
harbor2.png


商业转载请联系作者获得授权,非商业转载请注明出处,谢谢合作。


如果这篇文章帮助到了你,我感到十分荣幸!


📬 评论留言

icon_mrgreen.pngicon_neutral.pngicon_twisted.pngicon_arrow.pngicon_eek.pngicon_smile.pngicon_confused.pngicon_cool.pngicon_evil.pngicon_biggrin.pngicon_idea.pngicon_redface.pngicon_razz.pngicon_rolleyes.pngicon_wink.pngicon_cry.pngicon_surprised.pngicon_lol.pngicon_mad.pngicon_sad.pngicon_exclaim.pngicon_question.png2018new_aini_org.png2018new_baobao_thumb.png2018new_erha_org.png2018new_kuxiao_thumb.png2018new_yun_thumb.png2018new_hufen_thumb.png2018new_gui_org.png2018new_xiaoerbuyu_org.png2018new_heixian_thumb.png2018new_wabi_thumb.png2018new_tianping_thumb.png

站点地图 网站地图
豫ICP备17003270号-1 | Copyright © 2016-2020 靳闯博客
Typecho🍹Sgreen
TOP