Docker -compose install Harbor

  • Docker-compose Harbor install
  • Docker install
    • Yum install docker-compose
    • 首先安装 yum configuation 管理工具
    • [root@harbor-docker-registry ~]# yum install -y yum-utils
    • 配置docker源
    • [root@harbor-docker-registry ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    • 查看可安装的docker
    • [root@harbor-docker-registry ~]# yum list docker-ce.x86_64 --showduplicates |sort -r
    • 安装指定版本的docker

      yum install -y --setopt=obsoletes=0 \

      > docker-ce-19.03.3-3.el7

    • 启动docker服务
    • Systemctl start docekr
    • Systemctl enable docker 开机启动
  • Docker-compose install
    • 安装python
    • 配置epel-release 安装python-pip
    • [root@harbor-docker-registry ~]# yum install epel-release -y
    • 安装python-pip
    • [root@harbor-docker-registry ~]# yum install python-pip -y
    • 使用pip 安装docker-compose
    • [root@harbor-docker-registry ~]# pip install docker-compose
  • 下载harbor 离线安装包
  • CA证书
    • 获得CA颁发机构

      1.1获取ca私钥key

      openssl genrsa -out ca.key 4096

      1.2生成ca签名请求

      openssl req -x509 -new -nodes -sha512 -days 3650 \

      -subj "/C=CN/ST=Beijing/L=Beijing/O=lx/OU=lx/CN=harbor.aipo.lenovo.com" \

      -key ca.key \

      -out ca.crt

    • 获得服务器and域名私钥

      1.1生成服务器私钥

      openssl genrsa -out harbor.aipo.lenovo.com.key 4096

      1.2生成证书签名请求

      openssl req -sha512 -new \

-subj "/C=CN/ST=Beijing/L=Beijing/O=lx/OU=lx/CN=harbor.aipo.lenovo.com.com" \

-key harbor.aipo.lenovo.com.key \

-out harbor.aipo.lenovo.com.csr

   

   

   

  • 安装harbor
    • 修改harbor.yml文件配置下ip地址
    • 修改下存储路径 ---docker的--graph /home/docker
    • 修改下https 这里需要手动创建ca证书文件
    • 配置完成后执行.install.sh 即可。
  • 完成之后即可访问harbor的webUI
    •    

  • 安装harbor结束了需要注意的是在配置https的时候需要主机harbor.yml配置文件的证书配置以及配置文件的编写格式一定要注意空格哦,不然会瞎报错的让你找不到头绪的那种哈哈哈。https访问请按照官网进行操作证书。地址:https://github.com/goharbor/harbor/blob/master/docs/configure_https.md

   

猜你喜欢

转载自www.cnblogs.com/lbjstill/p/11850588.html
今日推荐