参考
https://github.com/vmware/harbor/blob/v1.1.0/docs/kubernetes_deployment.md
准备
yum install python-pip -y
pip install --upgrade pip
pip install docker-compose
wget https://github.com/vmware/harbor/releases/download/v1.1.0/harbor-online-installer-v1.1.0.tgz
tar -xvf harbor-online-installer-v1.1.0.tgz
cd harbor
编辑配置
eidt harbor.cfg
[root@es2-bm0606 harbor]# egrep 'ssl_cert|hostname|ui_url' harbor.cfg
hostname = reg-i.xzxpay.com
ui_url_protocol = https
ssl_cert = /data/cert/server.crt
ssl_cert_key = /data/cert/server.key
./install.sh
测试
[root@cloud4ourself-kube1 harbor]# docker version
Client:
Version: 1.12.6
API version: 1.24
Go version: go1.6.4
Git commit: 78d1802
Built: Tue Jan 10 20:20:01 2017
OS/Arch: linux/amd64
Server:
Version: 1.12.6
API version: 1.24
Go version: go1.6.4
Git commit: 78d1802
Built: Tue Jan 10 20:20:01 2017
OS/Arch: linux/amd64
[root@cloud4ourself-kube1 harbor]# docker login -u admin -p Harbor12345 reg-i.xzxpay.com
Login Succeeded
[root@cloud4ourself-kube1 harbor]#
[root@cloud4ourself-kube1 harbor]# docker pull centos:centos7
centos7: Pulling from library/centos
Digest: sha256:4eda692c08e0a065ae91d74e82fff4af3da307b4341ad61fa61771cc4659af60
Status: Downloaded newer image for centos:centos7
[root@cloud4ourself-kube1 harbor]# docker tag centos:centos7 reg-i.xzxpay.com/library/centos:centos7
[root@cloud4ourself-kube1 harbor]# docker push reg-i.xzxpay.com/library/centos:centos7
The push refers to a repository [reg-i.xzxpay.com/library/centos]
36018b5e9787: Pushed
centos7: digest: sha256:4eda692c08e0a065ae91d74e82fff4af3da307b4341ad61fa61771cc4659af60 size: 529
[root@cloud4ourself-mykc4 ~]# docker pull reg-i.xzxpay.com/library/centos:centos7
centos7: Pulling from library/centos
Digest: sha256:4eda692c08e0a065ae91d74e82fff4af3da307b4341ad61fa61771cc4659af60
Status: Downloaded newer image for reg-i.xzxpay.com/library/centos:centos7
#docker search
#curl http://localhost:5000/v1/search?q=postgresql
#curl http://10.10.105.71:5000/v2/_catalog
curl https://reg-i.xzxpay.com/api/search?q=google
# pull from dockerhub
D=`date +%Y%m%d`
for i in {nginx,redis}
do docker pull $i; docker tag $i:latest reg-i.xzxpay.com/dockerhub/$i:$D; docker push reg-i.xzxpay.com/dockerhub/$i:$D; done