Harbor
终端安装
下载地址:https://github.com/vmware/harbor/releases
安装文档:https://github.com/vmware/harbor/blob/master/docs/installation_guide.md
下载
推荐下载这种格式 Harbor offline installer
下载完之后放在/usr/local/src下面解压
[root@Centos7]#tar xvf harbor.v1.7.0.tar.gz
[root@Centos7 harbor]#vim harbor.cfg
hostname = 192.168.41.101 #我写的是本地ip
harbor_admin_password = 123456
解决依赖关系
1.安装docker 合适的版本
2.第一种安装 docker-compose #yum install docker-compose && systemctl start docker
第二种 yum install python-pip && pip install docker-compose && docker-compose start #优势比yum的新
安装
[root@Centos7 harbor]#./install.sh
[root@Centos7 harbor]#docker-compose version #查看版本
[root@Centos7 harbor]#docker-compose restart
如果需要更新
[root@Centos7 harbor]#./prepare
之后登陆对应的网址就可以了。
web管理
输入用户名密码 admin 123456
新建项目 helloworld 选择公开
开启授权 在其他服务器上
#dockerd --help查看帮助
vim /lib/systemd/system/docker.service
14 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --insecure-registry 192.168.41.101 --insecure-registry 192.168.41.102
[root@Docker hello]#systemctl daemon-reload
[root@Docker hello]#systemctl restart docker
确认状态已经开启
[root@Docker hello]#ps -ef | grep docker
root 26079 1 20 14:43 ? 00:00:06 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --insecure-registry 192.168.41.101 --insecure-registry 192.168.41.102
测试登陆
docker login 192.168.41.102
username admin
passwod 123456
测试传输
#新建一个镜像
docker build -t 192.168.41.102/helloworld/hello:v1 #helloworld 是在web界面创建的项目名。
#传输镜像
docker push 192.168.41.102/helloworld/hello:v1
#验证
此时web界面已经产生传输的数据
docker pull 192.168.41.102/helloworld/hello:v1 #换一台电脑下载。