Know How - Installing Docker in Azure VM

Introduction

This article helps you to run docker in Azure Virtual Machine.

This article covers the following

  • Creating Azure VM
  • Installing Docker
  • Enabling Hypervisor
  • Running Docker

What is docker?

Docker is an open-source containerization platform. It enables you to operate your application from the infrastructure so you can deliver the software quickly. You can read more about it here.

Docker provides the ability to package and run an application in a loosely isolated environment called a container. The isolation and security allow you to run many containers simultaneously on a given host. Your host can be a physical or virtual machine.

To make it simple, you have a host (can be a physical/virtual machine), and on top of it you will be installing docker (containerization platform). Using the docker, you will be creating containers (containing the actual application components to run the application).

Creating Azure VM

Here our host machine for docker is a virtual machine in Azure. Therefore, create a virtual machine in the Azure portal which has the following specifications.

  • OS: Windows 10 Enterprise version latest
  • Size: Standard D2s v3 (Some Sizes do not support hypervisor functionality, it won't directly indicate the size but you can't have the docker running successfully)

Installing Docker

Create an account in docker. Download and install docker from the hub.

At the end of the installation it asks you to log out and log in.

Enabling Hypervisor

Once you have logged in, wait for a minute to get the notification which asks you to enable hypervisor. Enable the hypervisor and wait for it to auto restart.

Installing Docker In Azure VM

Running Docker

After a moment, log in to the VM and wait for the docker desktop icon.

Docker will be showing as running in 2 to 3 minutes.

Installing Docker In Azure VM

Yah!! Now you have installed Docker in Azure VM and it is running successfully. You can check this by running the docker version command from the command prompt.

Installing Docker In Azure VM