docker 私有仓库 harbor
部署harbor思路
第一步:安装docker和docker-compose
第二步:下载harbor-offline-installer-v1.9.0-rc1.tgz
第三步:上传到/opt,并解压
第四步:修改harbor.yml配置文件 hostname = 10.0.0.11 harbor_admin_password = 123456
第五步:执行install.sh
部署harbor
1.下载软件包
[root@db01 ~/harbor]# wget https://github.com/goharbor/harbor/releases/download/v1.9.3/harbor-offline-installer-v1.9.3.tgz
2.解压下载的包
[root@db01 ~/harbor]# tar xf harbor-offline-installer-v1.9.0-rc1.tgz
3.修改配置文件
[root@db01 ~/harbor]# vim harbor.yml
hostname: 10.0.0.51
harbor_admin_password: 123456
4.下载安装docker-compose
[root@db01 ~/harbor]# yum install docker-compose -y
5.安装harbor
[root@db01 ~/harbor]# ./install.sh
[root@db01 ~/harbor]# docker images 查看一下
**6.****修改docker配置添加修改信任仓库
cat >/etc/docker/daemon.json<**{** **"registry-mirrors":
["https://ig2l319y.mirror.aliyuncs.com"],** **"insecure-registries": ["http://10.0.0.51"]****}EOFsystemctl restart docker**cat >/etc/docker/daemon.json<<EOF
{
"registry-mirrors": ["https://ig2l319y.mirror.aliyuncs.com"],
"insecure-registries": ["http://10.0.0.51"]
}
EOF
systemctl restart docker
7.docker登录harbor
[root@db01 ~/harbor]# docker login 10.0.0.51
8.给镜像打标签并提交到私有库中
[root@db01 ~/harbor]# docker tag da1ef69a0519 10.0.0.51/linux/my_kod:v2
9.上传镜像到私有仓库
[root@db01 ~/harbor]# docker push 10.0.0.51/linux/my_kod:v2
10.客户端使用仓库下载镜像
[root@db01 ~/harbor]# docker run -p 80:80 -d 10.0.0.51/linux/my_kod:v2