[root@bogon TomcatDockerfile]# docker build -t 192.168.3.106:5000/tomcat8.5 -f /usr/local/Dockerfile ....
Removing intermediate container f2e7093b9888
Successfully built 1c84c3188beb
[root@bogon local]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
192.168.3.106:5000/tomcat8.5 latest 1c84c3188beb 7 seconds ago 551 MB
docker.io/jenkinsci/blueocean latest a0ca1d437886 7 days ago 555 MB
docker.io/centos 7 9f38484d220f 3 weeks ago 202 MB
3.上传本地仓库
[root@bogon local]# docker push 192.168.3.106:5000/tomcat8.5
The push refers to a repository [192.168.3.106:5000/tomcat8.5]
Get https://192.168.3.106:5000/v1/_ping: http: server gave HTTP response to HTTPS client
由于Docker CLI默认以HTTPS访问,而部署的registry并未提供HTTPS,
因此,需要在pull镜像的Docker主机(192.168.3.106)添加HTTP可信任,
[root@bogon local]# cat /etc/docker/daemon.json {"registry-mirrors":["https://zjt2h6pk.mirror.aliyuncs.com"],
"insecure-registries":["192.168.3.106:5000"]}[root@bogon local]# service docker restart[root@bogon local]# docker push 192.168.3.106:5000/tomcat8.5
The push refers to a repository [192.168.3.106:5000/tomcat8.5]....
d69483a6face: Pushed
latest: digest: sha256:f2ca0c16ffa1dda992ea7b224139d11b98bff677929447744c0efc3996688dad size: 1367