接下来我们实验harbor离线安装包搭建镜像仓库
192.168.209.130 客户端
192.168.209.135 harbor离线安装包
系统:centos7.2
1,在135上新建一个文件夹
mkdir /harbor
2,下载一个离线包
https://github.com/goharbor/harbor/releases/tag/v1.7.8
这个包611M,可以采用迅雷下载会快点。下好了在传到135上。
3,135安装必须要的组件
yum -y install yum-utils docker device-mapper-persistent-data lvm2
vim /etc/sysconfig/docker
OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false --insecure-registry=192.168.209.135'
systemctl start docker
systemctl enable docker
curl -L https://github.com/docker/compose/releases/download/1.13.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
4,安装harbor
cd /harbor
tar -xf harbor-offline-installer-v1.7.8.tgz
cd /harbor/harbor
vim harbor.cfg
hostname: 192.168.209.135
harbor_admin_password: 123456
password: 123456
./install.sh
docker-compose ps
5,登录harbor
192.168.209.135:80
admin
123456
新建一个项目
6.从130上配置访问并上传镜像
vim /etc/docker/daemon.json
{
"insecure-registries":["192.168.209.131:5000","192.168.209.134","192.168.209.135"],
"registry-mirrors": ["https://wyrsf017.mirror.aliyuncs.com"]
}
systemctl daemon-reload
systemctl restart docker
docker login 192.168.209.135
docker tag nginx:v1 192.168.209.135/test1/nginx:v1
docker push 192.168.209.135/test1/nginx:v1
在页面上即可查看上传的镜像
获取下载地址
在135上下载
下载成功,实验成功完成!