Get In touch

Blog Details

Push Docker Images to Docker Hub

In this post, we’ll learn how to upload local docker images to docker hub.

I’m assuming you already have:

  1. Local docker image
  2. Account on docker hub
  3. Repository on docker hub

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:

Screenshot 2019-04-23 at 7.35.11 PM

List down docker images available locally:

docker images

You’ll see output like:

Screenshot 2019-04-23 at 7.19.13 PM

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:

Screenshot 2019-04-23 at 7.13.19 PM

Login to docker hub and check repository now has pushed images.

© 2022 QA Fiction. All rights reserved.