1.这个是我创建的项目
2.打tag
[root@localhost harbor]# docker tag nginx:latest 192.168.31.50:8009/dev/nginx:latest
3.登录到本地仓库
[root@localhost harbor]# docker login 192.168.31.50:8009 Username: admin Password: WARNING! Your password will be stored unencrypted in /root/.docker/config.json. Configure a credential helper to remove this warning. See https://docs.docker.com/engine/reference/commandline/login/#credentials-store Login Succeeded
4.推送
[root@localhost harbor]# docker push 192.168.31.50:8009/dev/nginx:latest The push refers to repository [192.168.31.50:8009/dev/nginx] a1bd4a5c5a79: Pushed 597a12cbab02: Pushed 8820623d95b7: Pushed 338a545766ba: Pushed e65242c66bbe: Pushed 3af14c9a24c9: Pushed latest: digest: sha256:557c9ede65655e5a70e4a32f1651638ea3bfb0802edd982810884602f700ba25 size: 1570