• 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安装

    wget https://github.com/goharbor/harbor/releases/download/v1.10.1/harbor-offline-installer-v1.10.1.tgz #下载文件

    解压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

     8、harbor启动和重启

    cd /harbor/harbor
    docker-compose up -d     #后台启动
    docker-compose restart   #重启
    做一个决定,并不难,难的是付诸行动,并且坚持到底。
  • 相关阅读:
    Keras学习率调整
    机器学习算法的调试---梯度检验(Gradient Checking)
    Python 上下文管理器
    Python垃圾回收机制
    Css 动画的回调
    全新的membership框架Asp.net Identity——绕不过的Claims
    CSS代码重构与优化
    html5 本地存储
    ASP.NET MVC 随想录
    谈谈Angular关于$watch,$apply 以及 $digest的工作原理
  • 原文地址:https://www.cnblogs.com/wukc/p/13273488.html
Copyright © 2020-2023  润新知