An Introduction to Docker on Windows

Martyn Fewtrell
UK Hydrographic Office
5 min readFeb 26, 2021

--

Do you hoover or vacuum your house? Many people would say hoover despite their vacuum cleaner being of a different brand. In the same way there is an analogy between Docker and containers.

People often refer to Docker when talking about containers and vice versa. In reality, Docker represents a suite of tools which are commonly used to manage and run containers. To get a better understanding of containers you can read my earlier blog post “Containers — What are they and why use them?”.

To understand the analogy it is worth taking a brief look at Docker history.

A brief history

Originally Docker existed as a start-up project within dotCloud, a small European Software as a Service (SaaS) company.

In 2013, Docker was released to the general public as an open sourced project. At this time Docker was based upon IBM Linux Containers (LXC) but as time moved on LXC was replaced by a new component libContainer.

In 2015, Docker strongly supported the Open Container Initiative which was launched to establish standards for container image and runtime specifications.

This close historical relationship with LXC and then the Open Container Initiative has probably led to some of the confusion and the analogy which exists today.

While there are other tools to manage containers, we are going to focus on Docker.

What does Docker give you?

When you install the various Docker components it enables you to work with containers in an efficient and effective way on both Windows and Linux platforms. It gives you the tools to containerise and share applications on multiple platforms including many of the available cloud solutions.

What are the prerequisites?

You can install and run Docker desktop on Mac, Linux and Windows 10 Pro.

On a Windows computer you will need a 64 bit processor, a minimum of 4 GB RAM (probably more) and BIOS Level hardware virtualisation. You will probably also need a significant amount of free drive space.

Of these, the first two requirements are straight forward to establish. To understand the third you should open Task Manager (Ctrl + Alt + Del and then select Task Manager). Within Task Manager, select the performance tab and check the list for ‘Virtualisation’. Hopefully it will say ‘Enabled’ which will reassure you that your computer supports virtualisation. Should it say ‘Disabled’ then you may have to further investigate your computer’s BIOS.

Task Manager

If your computer does not meet the prerequisites to run Docker Desktop then you can investigate the Docker Toolbox, which is an older set of tools, now deprecated but which may run on older systems.

Installing Docker Desktop

In order to work effectively with Docker Desktop you will need to register on the Docker website (www.docker.com). Creating an account is free but you will be required to supply a valid email address.

Once registered navigate to the Docker Hub (https://hub.docker.com) and look for the link to “Download for Windows”. The download is approximately 850 mega bytes so it may take a while on a slow internet connection but once the file has downloaded you can run the installer.

There are few options and in most cases the defaults should work without issue. Once the installation is complete you may receive a prompt offering to enable Hyper-V (Microsoft’s Virtualisation Platform). If this is the case, to use Docker Desktop you will need to accept this prompt and reboot your computer when requested.

After installation you may need to install or update the Windows Subsystem for Linux (WSL). Earlier versions of Docker ran Linux containers within a Linux virtual machine on Hyper-V. This approach was replaced after Microsoft enabled a Windows user with WSL to run a GNU/Linux environment, including most command-line tools, utilities and applications on Windows without the overhead of the virtual machine.

Once Docker is installed and a reboot completed (if necessary) you should see the Docker icon appear in the bottom tool bar.

The icon has the appearance of a whale loaded with containers on its back. If you right click on the icon you will see the various options available to you in the menu.

You should take note of the option “Switch to Linux containers…” which may instead read “Switch to Windows containers…”. You can use this option to toggle support between Windows and Linux containers depending on which you wish to run.

What did you install?

When you install Docker Desktop you actually install a number of tools which can be used to manage containers. These include:

  1. Docker Engine (the server side part of the tools which runs the containers and provides APIs to manage that process)
  2. Docker CLI Client (the command line options for interacting with the Docker Engine)
  3. Docker Compose (a tool to run multiple containers and orchestrate them to allow interaction between those containers)
  4. Notary (a tool for managing and publishing trusted collections of content)
  5. Kubernetes (an open source system for managing containers across multiple hosts which provides the mechanisms for deployment, maintenance and scaling of applications)
  6. Credential Helper (a tool for managing the Docker credentials)

Using Docker Desktop

In many cases you will interact with the Docker Engine by typing commands into a PowerShell window.

In order to check your new installation you can now open a PowerShell window and enter the command “docker” followed by the parameter “-v”. This is the command to request the version information from the Docker Engine. If all goes well you should see a result similar to the one below which gives you the version and build number.

Other tools

To manage your containers easily there are additional Graphical User Interface (GUI) tools available such as Docker Dashboard.

Docker Dashboard will provide you with additional information relating to which containers you have downloaded and run in an easy to digest format.

Conclusion

Docker Desktop is straight forward to download and install on Windows and provides a wealth of tools for running and managing containers. In my next post I will investigate the workflow and commands you will use to run and manage containers using Docker.

--

--

Martyn Fewtrell
UK Hydrographic Office

I am a software developer based in the South West of the United Kingdom predominantly working with Microsoft technologies.