1.在Docker Hub上创建镜像库
首先到到官网注册账号:https://hub.docker.com/
点击Repositories---->Create
填写镜像的名字即可,在右边可以看到推送镜像的命令
2.将本地镜像推送到Docker Hub
2.1.登陆Docker Hub
docker login -ujiangxlrepo 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
2.2.将本地镜像打标签成Docker Hub的仓库路径
docker tag kube-state-metrics:v1.8.0 jiangxlrepo/kube-state-metrics:v1.8.0
2.3.推送镜像
# docker push jiangxlrepo/kube-state-metrics:v1.8.0 The push refers to repository [docker.io/jiangxlrepo/kube-state-metrics] a76865c920eb: Mounted from lizhenliang/kube-state-metrics 932da5156413: Mounted from lizhenliang/addon-resizer v1.8.0: digest: sha256:0581aa6fd5945aa0b1786ec81d0584a80873bade7375ce4d224dbb7b712bf3f6 size: 738