![](https://fly-uni.com/wp-content/uploads/2023/11/image-62-1024x512.png)
1.注册docker hub账号
2.docker hub上创建仓库
![](https://fly-uni.com/wp-content/uploads/2023/11/image-64-1024x375.png)
3.docker hub 帐号在本地验证登陆
![](https://fly-uni.com/wp-content/uploads/2023/11/image-65.png)
4.将容器 commit 成镜像
docker tag <existing-image> <hub-user>/<repo-name>[:<tag>] docker commit 277e80820516 jerrymouseli/wvp_lirj:0322
![](https://fly-uni.com/wp-content/uploads/2023/11/image-66.png)
5.docker push 镜像到docker hub 的仓库
docker push <hub-user>/<repo-name>:<tag>
![](https://fly-uni.com/wp-content/uploads/2023/11/image-67.png)
大功告成
最后可以用以下命令验证一下,或者去docker hub仓库看一眼确认上传成功
docker inspect <hub-user>/<repo-name>:<tag>