1)配置yum源nginx
[root@host1 ~]# vim /etc/yum.repos.d/epel.repo [epel] name=epel baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7Server/x86_64/ enabled=1 gpgcheck=0
2)安裝docker-composedocker
[root@host1 ~]# yum install docker-compose
1)下載路徑vim
https://storage.googleapis.com/harbor-releases/harbor-offline-installer-v1.5.4.tgz
2)解壓api
[root@host1 ~]# tar xf harbor-offline-installer-v1.5.4.tgz [root@host1 ~]# mv harbor /usr/local/
3)編輯配置文件tcp
[root@host1 ~]# vim /usr/local/harbor/harbor.cfg
修改其中的一行 hostname,指定成本身的主機名ide
hostname = host1
4)啓動harboorgoogle
[root@host1 ~]# yum install docker-compose
啓動docker服務url
[root@host1 harbor]# ./prepare [root@host1 harbor]# ./install.sh
5)登陸harborunix
1)建立兩個項目:公開和非公開的
2)向nginx項目推送鏡像
3)給鏡像打標籤code
[root@host2 ~]# docker tag nginx:1.14-alpine 172.16.100.3/nginx/nginx:v1-1 [root@host2 ~]# docker tag nginx:1.14-alpine 172.16.100.3/nginx/nginx:v1-2 [root@host2 ~]# docker tag nginx:1.14-alpine 172.16.100.3/nginx/nginx:v1-3
{ "registry-mirrors": [ "https://registry.docker-cn.com", "https://mzxx8xy8.mirror.aliyuncs.com" ], "hosts": ["tcp://0.0.0.0:3725", "unix://var/run/docker.sock"], "insecure-registries": [ "host2:5000", "http://172.16.100.3" ] }
5)登陸docker倉庫,並推送
[root@host1 ~]# docker lognin http://172.16.100.3 ^C [root@host1 ~]# [root@host1 ~]# docker push 172.16.100.3/nginx/nginx