1、登录https://hub.docker.com/,没有账号注册一下
2、登录docker
[root@centos7 ~]# docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: xu
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
3、保存容器,上传至仓库
docker ps -qa //查看容器id
docker commit 8201b8779132 wordpress //选择对应的容器ID进行打包
docker tag wordpress xu/wordpress //对打包镜像打标签,需要注意这个标签的格式是 用户名/名称
docker push xuboy/wordpress 上传至服务器
4、查看上传情况
5、在其他主机上登录docker,就可以直接下载了
docker login
docker pull xuboy/wordpress