|NO.Z.00045|——————————|^^ 部署 ^^|——|CI/CD&Jenkins_Harbor部署.V02|——|部署_harbor.v2.0.0.V01|

一、Harbor镜像仓库部署——harbor.v2.0.0
### --- 下载harbor版本包
~~~     在 centos7.x 10.10.10.11 192.168.1.11 Harbor服务器部署操作
~~~     官方地址:https://github.com/goharbor/harbor/releases        
~~~     下载离线安装包:需要FQ

[root@harbor ~]# wget -c https://storage.googleapis.com/harbor-releases/release-2.0.0/harbor-offline-installer-v2.0.0-rc3.tgz
### --- 安装compose
~~~     uname -s:查看系统版本
~~~     uname -m:查看的是CPU平台,CPU架构
~~~     -o:存储路径

[root@harbor ~]# curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   633    0   633    0     0   1010      0 --:--:-- --:--:-- --:--:--  1011
100 11.2M  100 11.2M    0     0  89656      0  0:02:11  0:02:11 --:--:--  133k
~~~     # 为compose目录授予执行权限

[root@harbor ~]# chmod +x /usr/local/bin/docker-compose 
### --- 安装docker:启动harbor之前先启动docker:对版本要求不是很严格。
~~~     # 配置阿里云docker仓库

[root@harbor ~]# yum install -y yum-utils device-mapper-persitent-data lvm2 git
~~~     # 安装docker扩展源

[root@harbor ~]# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
~~~     # OR
[root@harbor ~]# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
~~~     # 查看docker-ce版本:查看可以选择的docker版本
[root@harbor ~]# yum list docker-ce --showduplicates|sort -r    
 
~~~     # 安装docker
[root@harbor ~]# yum install -y docker-ce-17.06.0.ce-1.el7.centos.x86_64 
~~~     # 启动docker
[root@harbor ~]# systemctl start docker
 
~~~     # 查看docker版本
[root@harbor ~]# docker -v
Docker version 17.06.0-ce, build 02c1d87
### --- 部署harbor
[root@harbor ~]# tar -zxvf harbor-offline-installer-v2.0.0-rc3.tgz 
 
~~~     # 修改harbor版本包配置参数
[root@harbor ~]# cd harbor/
[root@harbor harbor]# cp harbor.yml.tmpl harbor.yml
~~~     主机名要可以解析(需要部署dns服务器,用/etc/hosts文件没有用),
~~~     如果不可以解析,可以使用IP地址,需要修改的内容如下

[root@harbor harbor]# vim harbor.yml            
hostname: 10.10.10.11
#https:                                         # 如果要用https这里就需要改,现在我们先不用https,这里不需要改
  # https port for harbor, default is 443       # 注销https
  # port: 443
  # The path of cert and key files for nginx
  #certificate: /your/certificate/path
  #private_key: /your/private/key/path  
~~~     # 部署harbor版本包
[root@harbor harbor]# ./install.sh
[Step 5]: starting Harbor ...
Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating redis         ... done
Creating harbor-portal ... done
Creating registryctl   ... done
Creating harbor-db     ... done
Creating registry      ... done
Creating harbor-core   ... done
Creating harbor-jobservice ... done
Creating nginx             ... done
✔ ----Harbor has been installed and started successfully.----
### --- 查看部署过程中依赖的docker镜像
~~~     # 查看docker镜像

[root@harbor harbor]# docker images
REPOSITORY                      TAG                 IMAGE ID            CREATED             SIZE
goharbor/chartmuseum-photon     v2.0.0              4db8d6aa63e9        10 months ago       127MB
goharbor/redis-photon           v2.0.0              c89ea2e53cc0        10 months ago       72.2MB
goharbor/trivy-adapter-photon   v2.0.0              6122c52b7e48        10 months ago       103MB
~~~     # 查看运行的容器

[root@harbor harbor]# docker ps
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS                   PORTS                       NAMES
a7efd7e381c4        goharbor/nginx-photon:v2.0.0         "nginx -g 'daemon ..."   3 minutes ago       Up 3 minutes (healthy)   0.0.0.0:80->8080/tcp        nginx
baf75468ed29        goharbor/harbor-jobservice:v2.0.0    "/harbor/entrypoin..."   3 minutes ago       Up 3 minutes (healthy)                               harbor-jobservice
二、通过Chrome登录验证并配置
### --- 通过Chrome登录验证并配置

~~~     # 浏览器访问测试:http://10.10.10.11    http://192.168.1.11用户名:admin 密码:Harbor12345
~~~     ——>后台管理界面
~~~     # 创建仓库:项目——>新建项目
~~~     # 创建账户:用户管理——>创建用户
~~~     # 项目授权:授为管理员
~~~     # 仓库进行导入测试

 
 
 
 
 
 
 
 
 

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor

 

 

posted on   yanqi_vip  阅读(11)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示