harbor离线安装

Posted wukc

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了harbor离线安装相关的知识,希望对你有一定的参考价值。

环境:centos7.6

1、安装docker

详情见:https://www.cnblogs.com/wukc/p/13265528.html

2、配置时区 

timedatectl set-timezone Asia/Shanghai

3、修改主机名称

hostnamectl set-hostname harbor

4、创建磁盘并挂载

pvcreate /dev/vdb
vgcreate data /dev/vdb
lvcreate -l 100%VG -n lv_harbor data 
mkdir /harbor
mkfs.xfs /dev/mapper/data-lv_harbor
more /etc/fstab                       #配置开机挂载磁盘
UUID=f81a1f4f-5608-46bc-b4ef-6d0f675eeacd  /harbor   xfs  defaults        0 0
mount -a
[root@harbor-20 harbor]#  df /harbor
Filesystem                 1K-blocks    Used Available Use% Mounted on
/dev/mapper/data-lv_harbor 209608708 1415772 208192936   1% /harbor

5、harbor安装

上传文件待完善。。

技术图片
解压tar -zxvf /harbor/harbor-offline-installer-v1.10.1.tgz
加载镜像 cd harbor/&& docker load -i harbor.v1.10.1.tar.gz
将docker-compose 放到/usr/local/bin 目录下 并赋权
mv docker-compose  /usr/local/bin  && chmod u+x /usr/local/bin/docker-compose
进入解压目录,配置harbor.yml(修改ip、web密码、数据目录、注释https)
      hostname: 172.20.210.20 
       # 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: /harbor/data
新建数据目录 mkdir /harbor/data
环境预配          ./prepare
habbor安装        ./install.sh
       
Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating harbor-portal ... done
Creating registry      ... done
Creating redis         ... done
Creating harbor-db     ... done
Creating registryctl   ... done
Creating harbor-core   ... done
Creating harbor-jobservice ... done
Creating nginx             ... done
? ----Harbor has been installed and started successfully.----
View Code

6、登录验证

http://ip    账号密码为上面配置文件中:admin:Harbor12345

7、配置docker使用harbor仓库

修改配置文件
vi /etc/docker/daemon.json 
{
 "insecure-registries":["172.20.210.20"]  #添加harbor仓库地址
}
systemctl restart docker
docker login:172.21.210.20

 

以上是关于harbor离线安装的主要内容,如果未能解决你的问题,请参考以下文章

harbor 离线安装

centos 7离线安装harbor

Harbor高可用集群设计及部署(实操+视频),基于离线安装方式

系列CentOS 7.3 离线安装(无网络环境)CI CD环境之harbor

harbor离线安装

在linux上离线安装harbor的docker 私有仓库