需要把docker上传到harbor中。
1. 修改docker所在机器 /ect/docker/daemon.json,增加 "insecure-registries":["192.168.1.5"] ,"192.168.1.5" 为harbor的服务地址。
vim /etc/docker/daemon.json
{"insecure-registries": ["192.168.1.5"]}
注意如果daemon.json 不存在新增保存,如果存在则增加 "insecure-registries": ["192.168.1.5"]就可以。 按钮 "esc" 输入 :wq
2.在提示符下,输入以下内容配置和重启docker
[root@localhost ]# systemctl daemon-reload
[root@localhost ]# systemctl restart docker
3.登陆harbor
[root@localhost ]# docker login 192.168.1.5 Username : test Password: Login Succeeded [root@localhost ]#
输入 harbor的账号、密码
4.本机上将需要上传镜像格式话
docker tag nginx:latest 192.168.1.5/test/nginx:latest
5.上传影像
docker push 192.168.1.5/test/nginx:latest