How to push Docker Image to Docker Hub
- Login to docker hub using
docker login
- Prepare docker image to push to docker hub tagging repo name and version
docker image tag web1 <dockerhub-username>/web1:latest
- Check the tagged image
docker image ls
- Push the image to docker hub
docker image push <dockerhub-username>/web1
- Remove the docker image which you pushed to docker hub in last step
docker image rm -f [image id]
- Now pull the image from docker hub
docker pull <dockerhub-username>/web1