Harbor和YUM部署for CentOS 7

Posted Fatt

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Harbor和YUM部署for CentOS 7相关的知识,希望对你有一定的参考价值。

Harbor部署for CentOS 7

下载

  wget https://storage.googleapis.com/harbor-releases/release-1.7.0/harbor-offline-installer-v1.7.1.tgz
?
tar xvf harbor-offline-installer-<version>.tgz

Configure harbor.cfg

  hostname = 192.192.49.87
harbor_admin_password = Harbor12345

Install

  sudo ./install.sh

END

yum部署for CentOS 7

建立文件夹

  sudo mkdir -p /var/yum_data/centos/7/{os,updates,extras,other}/x86_64
sudo yum -y install createrepo
?
#同步某个repo到指定目录,不建议用
sudo reposync -r docker-ce-stable -p /var/yum_data/centos/7/other/
sudo reposync -r base -p /var/yum_data/centos/7/os/
?
#下载某个软件到指定目录,也不建议用
sudo yum install --downloadonly --downloaddir=
/var/yum_data/centos/7/other/x86_64/docker-ce-stable
docker-ce
?

创建repo

  #下载rpm到目标目录
sudo yum install --downloadonly --downloaddir=/var/yum_data/centos/7/other/x86_64/nginx/ nginx
?
sudo yumdownloader --resolve --destdir=/var/yum_data/centos/7/other/x86_64/docker-ce-stable/ docker-ce-18.09.1-3.el7
?
sudo yumdownloader --resolve --destdir=/var/yum_data/centos/7/other/x86_64/mariadb/ mariadb mariadb-server
?
sudo createrepo /var/yum_data/centos/7/other/x86_64
sudo createrepo --update /var/yum_data/centos/7/other/x86_64
?

nginx映射

  #harbor的yml 的proxy下添加
  volumes:
     - ./common/config/nginx:/etc/nginx:z
     - /var/yum_data:/var/yum_data:z
?

Harbor的nginx配置添加如下

/home/centos/harbor/common/config/nginx

      location /centos/ {
    root /var/yum_data;
    autoindex_exact_size off;
  }
?

客户端repo设置

下载添加repo

  sudo yum install -y  yum-utils device-mapper-persistent-data lvm2
?
sudo yum-config-manager --add-repo
http://192.192.49.87/centos/7/other/cnicg.repo
?
sudo yum clean all
sudo yum makecache
sudo yum --disablerepo=base,updates,extras install -y mariadb mariadb-server

cnicg.repo

  # cnicg repo
# copy this repo to destination-host,‘/etc/yum.repos.d/‘
# and run ‘sudo yum clean all && sudo yum makecache‘
?
[cnicg]
name=CentOS-$releasever - cnicg
baseurl=http://192.192.49.87/centos/$releasever/other/$basearch/
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

END















































以上是关于Harbor和YUM部署for CentOS 7的主要内容,如果未能解决你的问题,请参考以下文章

Harbor的简单部署

centos 7离线安装harbor

Centos 7.x部署Harbor镜像仓库

企业级Docker私有仓库之Harbor部署(http)

Harbor仓库的搭建并实现harbor的高可用

harbor仓库部署