前序: ??? ??? 🔗第一步:私有镜像仓库Harbor的安装部署 |
输入命令
docker images
打印返回
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu 16.04 b6f507652425 2 years ago 135MB
输入命令
docker ps -a
打印返回
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e80c30a2e599 ubuntu:16.04 "bash" 7 days ago Exited (0) 18 hours ago 0.0.0.0:8801->80/tcp, :::8801->80/tcp ubuntu-1
docker commit -a "lxcw" -m "for vAC keepalived+nginx" ubuntu-1 vac_ubuntu:v0.1
输入命令
docker images
打印返回
REPOSITORY TAG IMAGE ID CREATED SIZE
vac_ubuntu v0.1 b1e07b814206 23 hours ago 444MB
ubuntu 16.04 b6f507652425 2 years ago 135MB
docker tag vac_ubuntu:v0.1 192.168.100.120:8802/library/vac_ubuntu:v0.1
输入命令
docker images
打印返回
REPOSITORY TAG IMAGE ID CREATED SIZE
vac_ubuntu v0.1 b1e07b814206 23 hours ago 444MB
192.168.100.120:8802/library/vac_ubuntu v0.1 b1e07b814206 23 hours ago 444MB
ubuntu 16.04 b6f507652425 2 years ago 135MB
docker login -u admin -p Harbor12345 192.168.100.120:8802
输入命令
docker push 192.168.100.120:8802/library/vac_ubuntu:v0.1
打印返回
The push refers to repository [192.168.100.120:8802/library/vac_ubuntu]
fedb7970623a: Pushed
1251204ef8fc: Pushed
47ef83afae74: Pushed
df54c846128d: Pushed
be96a3f634de: Pushed
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
vac_ubuntu v0.1 b1e07b814206 23 hours ago 444MB
192.168.100.120:8802/library/vac_ubuntu v0.1 b1e07b814206 23 hours ago 444MB
ubuntu 16.04 b6f507652425 2 years ago 135MB
docker rmi 192.168.100.120:8802/library/vac_ubuntu:v0.1
输入命令
docker images
打印返回
REPOSITORY TAG IMAGE ID CREATED SIZE
vac_ubuntu v0.1 b1e07b814206 24 hours ago 444MB
ubuntu 16.04 b6f507652425 2 years ago 135MB
docker pull 192.168.100.120:8802/library/vac_ubuntu:v0.1
输入命令
docker images
打印返回
REPOSITORY TAG IMAGE ID CREATED SIZE
192.168.100.120:8802/library/vac_ubuntu v0.1 b1e07b814206 24 hours ago 444MB
vac_ubuntu v0.1 b1e07b814206 24 hours ago 444MB
ubuntu 16.04 b6f507652425 2 years ago 135MB
问题重现
The push refers to repository [192.168.100.120:8802/library/vac_ubuntu] Get "http://192.168.100.120:8802/v2/": dial tcp 192.168.100.120:8802: connect: no route to host |
原因: 防火墙未允许8802端口通过,关闭Harbor仓库所在主机的防火墙,或者打开8802端口规则 解决方法: 关闭防火墙 |
输入命令
systemctl stop firewalld
问题重现
Error response from daemon: Get "http://192.168.100.120:8802/v2/": dial tcp 192.168.100.120:8802: connect: connection refused |
原因: docker客户端未添加白名单,即忽略安全注册表 解决方法: 如下 |
输入命令
vim /etc/docker/daemon.json
增加内容
{
"insecure-registries": ["192.168.100.120:8802"]
}
重启守护进程
systemctl daemon-reload
重启docker
systemctl restart docker
测试登录
docker login -u admin -p Harbor12345 192.168.100.120:8802