折腾了两个小时,终于好了
https://github.com/docker/distribution/issues/1874 这是github docker 的相关问题
需要 push 到私有仓库端的操作 ,就是需要上传的那台服务器
vim /etc/docker/daemon.json
1: 配置
{
"insecure-registries":["公网ip(别把22端口加上了):5000"]
}
2:重启 docker
systemctl restart docker
私有仓库端 服务端那台
docker ps
3:先查看是否启动状态, 并且看 ports 是不是 5000端口 映射 容器 5000
4:推送端 docker push image (前提:把镜像名 改为 server端 ip + 端口 + 镜像名 例如 )
docker tag centos 120.0.0.0:8080/testcentos
docker push centos 120.0.0.0:8080/testcentos
成功了,最重要的是第一步配置别配置错了!