In this post, we’ll learn how to upload local docker images to docker hub.
I’m assuming you already have:
Note: Make sure to replace diamonds <> (e.g. <username>) with actual values.
Log into the Docker Hub from the command line:
docker login -u <username> -p <password>
You’ll see output:
List down docker images available locally:
docker images
You’ll see output like:
Tag your image (syntax):
docker tag <IMAGE ID> <docker-hub-username>/<docker-hub-repo>:<tag-name>
Tag your image (example):
docker tag 164dbfe4d023 shwetankvashishtha/local-images:selenium-image
Push your image to docker hub (syntax):
docker push <docker-hub-username>/<docker-hub-repo>
Push your image to docker hub (example):
docker push shwetankvashishtha/local-images
On successful, You’ll see output:
Login to docker hub and check repository now has pushed images.