• Harbor安装测试记录


    安装docker环境

    # Uninstall old versions
    yum remove docker 
                      docker-client 
                      docker-client-latest 
                      docker-common 
                      docker-latest 
                      docker-latest-logrotate 
                      docker-logrotate 
                      docker-engine
    
    
    
    
    # Install using the repository
    yum install -y yum-utils 
      device-mapper-persistent-data 
      lvm2
    
    
    yum-config-manager 
        --add-repo 
        https://download.docker.com/linux/centos/docker-ce.repo
    
    
    yum install docker-ce docker-ce-cli containerd.io -y
    
    # Boot the service
    systemctl start docker
    systemctl enable docker
    

    安装docker-compos

    yum install docker-compose -y
    或者 
    curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/bin/docker-compose
    chmod +x /usr/bin/docker-compose
    

    安装harbor

    GitHub

    # wget https://storage.googleapis.com/harbor-releases/release-1.8.0/harbor-offline-installer-v1.8.0.tgz
    # tar zxvf harbor-offline-installer-v1.8.0.tgz
    # cd harbor
    # vi harbor.yml  //修改hostname为当前主机IP
    # ./prepare  //预处理
    # ./install.sh //执行安装操作
    # docker ps //harbor正常启动的容器组件,nginx,jobserver,ui,redis,registry,db,log
    

    浏览器访问

    user:admin passwd:Harbor12345 密码保存在harbor.cfg配置文件中
    

    docker配置

    # vi  /usr/lib/systemd/system/docker.service
    ExecStart=/usr/bin/dockerd --insecure-registry g-registry01.bjyztj.sjhl
    
    # systemctl daemon-reload
    # systemctl restart docker
    
    # docker tag nginx:latest g-registry01.bjyztj.sjhl/test/nginx:mytest
    # docker push g-registry01.bjyztj.sjhl/test/nginx:mytest
    # docker pull g-registry01.bjyztj.sjhl/test/nginx:mytest
    

    启用https

    https模式需要启用域名解析

    mkdir /data/cert -p
    cd /data/cert
    openssl genrsa -out /data/cert/ca_harbor.key 2048
    openssl req -x509 -new -nodes -key /data/cert/ca_harbor.key -subj "/CN=g-registry01.bjyztj.sjhl" -days 5000 -out /data/cert/ca_harbor.crt
    openssl req -x509 -new -nodes -key /data/cert/ca_harbor.key -subj "/CN=g-registry02.bjyztj.sjhl" -days 5000 -out /data/cert/ca_harbor.crt
    
    cd ~/harbor
    # vi harbor.yml
    --------------------------------------------
    hostname: g-registry01.bjyztj.sjhl
    # https related config
    https:
    #   # https port for harbor, default is 443
      port: 443
    #   # The path of cert and key files for nginx
      certificate: /data/cert/ca_harbor.crt
      private_key: /data/cert/ca_harbor.key
    --------------------------------------------
    
    cd ~/harbor
    docker-compose down
    ./install.sh
    
  • 相关阅读:
    Docker 0x05: Dockerfile制作镜像
    Docker 0x04: Docker 基本使用
    Docker 0x03:Install Docker
    Docker 0x02: Docker生态
    Docker 0x01:Docker Container容器技术
    Axios发送AJAX请求
    Django学习之十三:提高页面开发效率减少冗余的模板系统
    javascript获取指定区间范围随机数
    完美解决eclipse编辑器中文字符过小问题
    mysql查询表所有列名,并用逗号分隔
  • 原文地址:https://www.cnblogs.com/lixinliang/p/14519210.html
Copyright © 2020-2023  润新知