Pulling Base Container Images

So far, we have deployed our container in the Nano Server VM and Windows Server VM. The next piece of work is to pull down the Images for these containers. The Docker is the container which we have created so far. In the following lab, we will pull some images for that container from the Microsoft Container images repository.

Step 1 Surfing Docker Hub

  • We shall surf for the docker hub website which actually contains the various container images. We are going to work with the windows machines and hence we shall try pulling the images that are provided by the Microsoft. Hit the following URL to reach the docker hub.

    https://hub.docker.com/
  • Now in the search box, search for Microsoft Nano Server. You will be getting some bunch of operating systems. Click on the first one which is the official Nano Server Image.

    Nano Server

  • After clicking on the image, you will get a window that consists of the code which can be used in the PowerShell to pull the image.

    Nano Server

Step 2 Pulling the latest Image

  • Now login into the DockerVM which we have created initially. This VM consists of the Docker Container installed in it. So we can download our Images in there.

  • Now we shall try downloading the Images from the Images repository which we have seen in the docker hub. To pull the image from there, we should run the following PowerShell command by opening PowerShell in the administrator rights.

    docker pull microsoft/nanoserver
  • By default, this will pull the latest update of the Nano Server image that is available in the Image repository. This will take 2 to 3 minutes to get download.

    Nano Server

Step 3 Pulling the Specific Image

  • This time we shall try pulling some specific image from the repository. For that click on the tag option in the docker hub.

    Nano Server

  • There you can find different tags for different versions of the images. Now we shall try downloading some old version. For that we need to choose the required version from the tags and copy the tag ID to pull that image.

  • Now come back to power shell and run the following command to pull the image. Here replace the yellow part with the version which you want to pull. This will again take a few more minutes to get installed.

    docker pull microsoft/nanoserver -10.0.14393.1358_ru-ru

    Nano Server

Step 4 Checking the Pulled Images

  • Now, we shall check for the docker images that we have pulled from the repository. For this run the command,

    docker images

    Nano Server

Step 5 Pulling Windows Server Core Image

  • Again, we shall try pulling the Windows Server Image from the Docker repository. For this run the command

    docker pull microsoft/windowsservercore
  • Server Core is large in size and it will take some time to get downloaded. Just wait for it to get downloaded.

    Nano Server

  • Again, run the docker images to view the images which you have downloaded.

    Nano Server

  • Thus, we have successfully pulled the images which we require to run inside the Docker Container.


Similar Articles