docker-compose版本有要求
curl -L https://github.com/docker/compose/releases/download/1.8.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
rz harbor文件
tar zxf harbor-offline-installer-v1.5.0.tgz
cd harbor
vim harbor.cfg
[root@test2 harbor]# ll
total 854960
drwxr-xr-x 3 root root 23 Apr 5 01:32 common
-rw-r--r-- 1 root root 1185 May 2 2018 docker-compose.clair.yml
-rw-r--r-- 1 root root 1725 May 2 2018 docker-compose.notary.yml
-rw-r--r-- 1 root root 3596 May 2 2018 docker-compose.yml
drwxr-xr-x 3 root root 156 May 2 2018 ha
-rw-r--r-- 1 root root 6687 May 2 2018 harbor.cfg
-rw-r--r-- 1 root root 875401338 May 2 2018 harbor.v1.5.0.tar.gz
-rwxr-xr-x 1 root root 5773 May 2 2018 install.sh
-rw-r--r-- 1 root root 10771 May 2 2018 LICENSE
-rw-r--r-- 1 root root 482 May 2 2018 NOTICE
-rwxr-xr-x 1 root root 27379 May 2 2018 prepare
---------------------------------------------------------------------------------------------------------------------------------------------------
sed -i "s/hostname = reg.mydomain.com/hostname = 192.168.3.229/g" ./harbor.cfg
sed -i "s/harbor_admin_password = Harbor12345/harbor_admin_password = 【password】/g" ./harbor.cfg
./prepare && ./install.sh
访问ip
用户名admin密码【password】--创建项目,当然可以直接推
其他主机地址
vim /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd-current 中插入下面一行(很重要,登录出错都在这里 必须重启)
--insecure-registry=192.168.3.228:5000 \
systemctl daemon-reload && systemctl restart docker
docker tag centos:7 192.168.3.229/test/c:7
docker login 192.168.3.229
push