Pushing container images to docker

Push and Pull container images to docker hub

In this blog, we will show you how to push and pull container images to docker hub using PowerShell docker commands.

SIGNUP USER WITH DOCKER HUB

  • First, Go to hub.docker.com website.
push and pull container images to docker hub
  • Provide dockerID, email address & password to signup with docker hub website.
push and pull container images to docker hub
  • Once you click the sign-up button, It shows the below screen.
push and pull container images to docker hub
  • We will get the confirmation email to our inbox. We need to click on that link to activate it.
push and pull container images to docker hub
  • Once you click on the activation link, it shows the login page.
push and pull container images to docker hub
  • Now provide docker ID and password and click login.
push and pull container images to docker hub
  • Once we logged in, it shows the below screen.
push and pull container images to docker hub

RE-TAGGING THE IMAGES

  • In this demo, we use logesassistanz as username and it will be the namespace and should be included in the image names.
  • Go to PowerShell window and list the images.
push and pull container images to docker hub
  • If we look into the base container OS images they are formatted with the name Microsoft.
push and pull container images to docker hub
  • Basically, it contains namespace/name of the repository where images available. Our images are currently tagged as web. We need to re-tag these images. So execute the below command to re-tag the images.

docker tag web:latest logesassistanz/web:latest

push and pull container images to docker hub
push and pull container images to docker hub
  • Run the docker images command to verify the changes.
push and pull container images to docker hub
  • Now, untag the old image from the image list.
push and pull container images to docker hub
  • Now everything is set. Images are looking manageable now.
push and pull container images to docker hub

LOGGING INTO DOCKER HUB

  • Login into docker hub from Powershell, execute the below command.

docker login

push and pull container images to docker hub
  • Provide the username/password to login into docker hub. After successful login, it shows Login succeeded.
push and pull container images to docker hub

PUSHING IMAGES INTO DOCKER HUB

  • To push the images into docker hub, execute the below command.

docker push logesassistanz/web:latest

push and pull container images to docker hub
  • Now push web v1 version image.
push and pull container images to docker hub
  • Now check the docker hub repository and we can able to find our two tags of our images.
push and pull container images to docker hub
  • To make this repository as private, Click on settings.
push and pull container images to docker hub
  • Click on Make Private button.
push and pull container images to docker hub
  • Type the word web and click confirm.
push and pull container images to docker hub
  • That’s it. This repository is now private.
push and pull container images to docker hub
PULLING CONTAINER IMAGES
  • First, we will remove the existing images from the list using rmi command.
push and pull container images to docker hub
  • Run docker images command to verify the image lists.
push and pull container images to docker hub
  • To pull the images, use the below command.

Syntax : docker pull <namespace name>/<repository name>:<tag>

Example : docker pull logesassistanz/web:v1

push and pull container images to docker hub
push and pull container images to docker hub
  • The process completed successfully. Type docker images command to verify it.
push and pull container images to docker hub

VIDEO

Thanks for reading this blog. We hope it was useful for you to learn how to pull and push images using docker hub repository.

Loges