首先保证可以访问Docker Hub,所以需要先把host替换一下 : Google hosts ;
然后就是注册Docker Hub账户:https://hub.docker.com/;
然后就是在账户中创建仓库:Create Repository;
下一步就是在Docker中登陆账户:docker login --username=username --password=password --email=email
也可以直接用:docker login,然后会提示你输入对应信息,输入完就回车;
查看本地镜像:docker images;
修改镜像tag:tag:docker tag <imageID> <namespace>/<image name>:<version tag eg latest>;
上传镜像:docker push <namespace>/<image name>;
静待上传完成就可以了。
另外顺便提一句,当不小心退出容器,想要重新进入容器可以用 : docker start -i container_name/ID
就是再启用容器的命令中加上-i参数就可以进入容器了。