前言

   Harbor可以通过Docker Composer的方式来部署,如果有正常运行的k8s环境,也可以使用k8s来部署Harbor,本文采用 Docker Composer的方式。

准备

  假定Linux系统为Centos 7。

docker ,默认安装即可
yum -y install docker
1
docker compose ,安装最新版
curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
1
2
harbor离线安装包,下载最新版本,如果在线下载失败,我上传了一份到百度云:https://pan.baidu.com/s/1dnDZjg
wget https://storage.googleapis.com/harbor-releases/harbor-offline-installer-v1.3.0.tgz
1
导入 harbor 镜像

  解压harbor离线安装包

tar -xzvf harbor-offline-installer-v1.3.0.tgz
1
  进入harbor目录

cd harbor
1
  有如下文件:

  导入harbor镜像

docker load -i harbor.v1.3.0.tar.gz
1
如果提示:Cannot connect to the Docker daemon. Is the docker daemon running on this host? 是因为docker服务未启动,使用systemctl start docker命令运行docker。

修改 harbor 配置

  编辑 harbor.cfg文件

vi harbor.cfg
1
  修改hostname为自己机器的ip地址

hostname = 192.168.22.83
1
  当然,harbor还有很多配置项可以修改,来满足一些企业级的功能特性,比如可以使用https来保证文件传输的安全。在这里,为了可以快速上手,只进行简单的配置。

安装与启动

  执行 install.sh 脚本

./install.sh
1
  等待安装完成:

[Step 0]: checking installation environment ...

Note: docker version: 1.12.6

Note: docker-compose version: 1.18.0

[Step 1]: loading Harbor images ...
Loaded image: vmware/harbor-adminserver:v1.3.0
Loaded image: vmware/photon:1.0
Loaded image: vmware/notary-photon:signer-0.5.1
Loaded image: vmware/postgresql:9.6.5-photon
Loaded image: vmware/harbor-db-migrator:1.3
Loaded image: vmware/harbor-ui:v1.3.0
Loaded image: vmware/harbor-log:v1.3.0
Loaded image: vmware/nginx-photon:1.11.13
Loaded image: vmware/mariadb-photon:10.2.10
Loaded image: vmware/clair:v2.0.1-photon
Loaded image: vmware/harbor-db:v1.3.0
Loaded image: vmware/harbor-jobservice:v1.3.0
Loaded image: vmware/registry:2.6.2-photon
Loaded image: vmware/notary-photon:server-0.5.1

[Step 2]: preparing environment ...
Clearing the configuration file: ./common/config/adminserver/env
Clearing the configuration file: ./common/config/ui/env
Clearing the configuration file: ./common/config/ui/app.conf
Clearing the configuration file: ./common/config/ui/private_key.pem
Clearing the configuration file: ./common/config/db/env
Clearing the configuration file: ./common/config/jobservice/env
Clearing the configuration file: ./common/config/jobservice/app.conf
Clearing the configuration file: ./common/config/registry/config.yml
Clearing the configuration file: ./common/config/registry/root.crt
Clearing the configuration file: ./common/config/nginx/cert/harbor.pem
Clearing the configuration file: ./common/config/nginx/cert/harbor-key.pem
Clearing the configuration file: ./common/config/nginx/nginx.conf
Clearing the configuration file: ./common/config/log/logrotate.conf
loaded secret from file: /data/secretkey
Generated configuration file: ./common/config/nginx/nginx.conf
Generated configuration file: ./common/config/adminserver/env
Generated configuration file: ./common/config/ui/env
Generated configuration file: ./common/config/registry/config.yml
Generated configuration file: ./common/config/db/env
Generated configuration file: ./common/config/jobservice/env
Generated configuration file: ./common/config/log/logrotate.conf
Generated configuration file: ./common/config/jobservice/app.conf
Generated configuration file: ./common/config/ui/app.conf
Generated certificate, key file: ./common/config/ui/private_key.pem, cert file: ./common/config/registry/root.crt
The configuration files are ready, please use docker-compose to start the service.

Creating harbor-log ... done
[Step 3]: checking existing instance of Harbor ...

Creating registry ... done
Creating harbor-ui ... done
Creating network "harbor_harbor" with the default driver
Creating nginx ... done
Creating harbor-adminserver ... 
Creating harbor-db ... 
Creating registry ... 
Creating harbor-ui ... 
Creating harbor-jobservice ... 
Creating nginx ...

✔ ----Harbor has been installed and started successfully.----

Now you should be able to visit the admin portal at https://192.168.22.83. 
For more details, please visit https://github.com/vmware/harbor .

  在浏览器中输入ip地址:http://192.168.22.83(注意这里使用http协议,而非https),用户名:admin 密码:Harbor12345(可以harbor.cfg文件中设置) ,登录看到barbor的图像界面:

小结

  harbor 安装成功后,可以分别通过以下命令来停止启动(注意:需要在上面提到的harbor目录中执行)

docker-compose down -v
//停止

docker-compose up -d
//启动

Harbor:私有企业级Registry仓库--快速搭建相关推荐

  1. docker进阶-搭建私有企业级镜像仓库Harbor

    为什么要搭建私有镜像仓库   对于一个刚刚接触Docker的人来说,官方的Docker hub是用于管理公共镜像.既然官方提供了镜像仓库我们为什么还要去自己搭建私有仓库呢?虽然也可以托管私有镜像.我们 ...

  2. rancher添加私有仓库_使用Rancher和私有仓库快速搭建Kubernetes集群

    来来来,先出题:Rancher可以快速部署Kubernetes,但其使用的gcr.io上的镜像无法下载怎么办?使用Rancher可以快速部署Kubernetes,但我们需要下载哪些镜像?Rancher ...

  3. 分分钟搞定阿里云私有Docke镜像仓库的搭建

    前言: 所谓私有仓库,也就是在本地(局域网)搭建的一个类似公共仓库的东西,搭建好之后,我们可以将自己的镜像提交到私有仓库中.这样我们既能使用 Docker 来运行我们的项目镜像,也避免了商业项目暴露出 ...

  4. 打docker镜像_分分钟搞定阿里云私有Docke镜像仓库的搭建

    前言:  所谓私有仓库,也就是在本地(局域网)搭建的一个类似公共仓库的东西,搭建好之后,我们可以将自己的镜像提交到私有仓库中.这样我们既能使用 Docker 来运行我们的项目镜像,也避免了商业项目暴露 ...

  5. 87: 企业监控系统部署 、 搭建Harbor私有仓库 、 总结和答疑

    Top NSD PROJECT3 DAY04 案例1:部署zabbix监控服务器 案例2:制作Zabbix客户端RPM软件包 案例3.Zabbix自动化监控 案例4.自定义Zabbix监控项目 案例5 ...

  6. 搭建Harbor企业级docker仓库

    from: https://www.cnblogs.com/pangguoping/p/7650014.html 搭建Harbor企业级docker仓库 一.Harbor简介 1.Harbor介绍 H ...

  7. 1+X 云计算运维与开发(中级)案例实战——搭建harbor私有仓库并实现主从同步

    1+X 云计算运维与开发(中级)案例实战--搭建harbor私有仓库并实现主从同步 前言 思路 实操 1.(个人习惯)修改主机名,添加主机映射 2. 配置镜像加速器 3. 生成CA证书,并分发证书 4 ...

  8. 搭建Harbor私有镜像仓库

    Docker容器应用的开发和运行离不开可靠的镜像管理,部署一个私有的镜像仓库是十分有必要的.虽然Docker官方提供了docker-registry用于构建私有的镜像仓库.但它的功能没有Harbor丰 ...

  9. Docker容器私有仓库——Harbor私有仓库的搭建

    Docker容器私有仓库--Harbor私有仓库的搭建 一.Harbor介绍 1.Harbor概念 2.Harbor的核心组件 3.Harbor的优点 二.Harbor搭建的环境准备 1.当前Harb ...

最新文章

  1. Win10上装虚拟机运行Ubuntu16.04
  2. 模型蒸馏(Distillation)
  3. Codeforces Round #349 (Div. 1) A. Reberland Linguistics 动态规划
  4. 黑入苹果特斯拉竟如此容易!这位鬼才的攻击方法火了,微软等35家公司一起悬赏...
  5. 龙格-库塔(Runge-Kutta)方法数学原理及实现
  6. windows如何安装python-手把手教你如何在windows系统安装python?
  7. 南邮微型计算机实验,南邮 微机原理 微型计算机与接口技术 微机原理实验.doc...
  8. powerpoint预览_如何放大和缩小PowerPoint演示文稿的一部分
  9. P4130,jzoj1214-[NOI2007]项链工厂【线段树】
  10. 前端开发小工具SuperApp——Ctrl+S自动刷新浏览器
  11. PDF如何旋转页面 PDF旋转页面的方法
  12. 计算机 取得高级权限,win10获取system权限,win7获取最高权限
  13. mp4转mp3,mp4转换成mp3方法步骤
  14. matlab光斑中心,Matlab学习手记——二维高斯曲面拟合法定位光斑中心
  15. PHP获取以毫秒级为单位获取当前时间
  16. 支付宝小程序H5域名配置
  17. ROS机器人控制 —— 键盘方向控制
  18. Win10图片查看器打不开图片,报错内存不足
  19. 个人所得税的计算表格
  20. python新年贺卡_写个新年贺卡生成器,各位小伙伴们新年快乐呀~

热门文章

  1. 453. 最小操作次数使数组元素相等
  2. 力扣合并两个有序数组
  3. vscode 配置 pcl头文件库
  4. 使用numpy.tanh()打印矢量/矩阵元素的双曲正切值 使用Python的线性代数
  5. 调试JavaScript代码
  6. 小数 ###_C#中的小数关键字
  7. 汇编语言-013(DAS 、DAA与DAS、QWORD类型用SBB借位减法、编写指令将AX符号扩展到EAX,不能使用CWD、用SHR和条件判断指令将AL循环右移一位、SHLD、压缩十进制转换)
  8. HTML5 学习笔记
  9. 周易Java_周易API接口_免费数据接口 - 极速数据
  10. html在线编辑器 asp.net,ASP.NET网站使用Kindeditor富文本编辑器配置步骤