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
hostname = 192.192.49.87
harbor_admin_password = Harbor12345
sudo ./install.sh
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
#下載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
#harbor的yml 的proxy下添加
volumes:
- ./common/config/nginx:/etc/nginx:z
- /var/yum_data:/var/yum_data:z
/home/centos/harbor/common/config/nginxnginx
location /centos/ {
root /var/yum_data;
autoindex_exact_size off;
}
下載添加repodocker
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.repocentos
# 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