harbor安装

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum -y install docker
systemctl start docker
systemctl enable docker
systemctl status docker
docker version
yum -y install certbot libevent-devel gcc libffi-devel python-devel openssl-devel python2-pip
pip install --upgrade pip
pip install -U docker-compose
docker-compose version
wget https://storage.googleapis.com/harbor-releases/release-1.4.0/harbor-offline-installer-v1.4.0.tgz
tar -xf harbor-offline-installer-v1.4.0.tgz
cd harbor
vim harbor.cfg
hostname = ip
harbor_admin_password = 密码
./install.sh

harbor缓存远程docker镜像 execstrat增长insecure-registry配置python

vi /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd-current \
          --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \
          --default-runtime=docker-runc \
          --exec-opt native.cgroupdriver=systemd \
          --userland-proxy-path=/usr/libexec/docker/docker-proxy-current \
          --insecure-registry=192.168.6.233 \
          $OPTIONS \
          $DOCKER_STORAGE_OPTIONS \
          $DOCKER_NETWORK_OPTIONS \
          $ADD_REGISTRY \
          $BLOCK_REGISTRY \
          $INSECURE_REGISTRY\
          $REGISTRIES

重启docker服务redis

systemctl daemon-reload
systemctl restart docker
systemctl status docker

 

关闭harbordocker

docker-compose stop
#docker-compose rm -f

启动harborvim

docker-compose up -d

登陆私有仓库帐号api

docker login http://ip:端口

 推一个镜像到私有仓缓存

docker pull redis
docker tag redis 192.168.6.233/library/redis
docker push 192.168.6.233/library/redis