语法 docker tag [OPTIONS] IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]
docker tag eureka:v1 127.0.0.1:85/tensquare/eureka:v1
docker push 127.0.0.12:85/tensquare/eureka:v1
如果出现以下错误,是因为Docker没有把Harbor加入信任列表中
The push refers to repository [192.168.66.102:85/tensquare/eureka]
Get https://192.168.66.102:85/v2/: http: server gave HTTP response to HTTPS
client
vi /etc/docker/daemon.json
{"registry-mirrors": ["https://zydiol88.mirror.aliyuncs.com"],"insecure-registries": ["127.0.0.1:85"]}
注意: 如果添加信任列表,中不能由任何的空格(换行也不行,否则会有错误)
需要重启Docker
需要先登录Harbor,再推送镜像
docker login -u 用户名 -p 密码 127.0.0.1:85
Login Succeeded
证明登录成功
然后在重新执行推送命令