Introducing Docker Containers Open Source As A Plugin In Microsoft Azure

Developers generally test client server applications on staging servers before deploying them on the production servers. This process has been rendered more complex by the increasing intricacies of the steps that are involved in building, configuring, and testing the application. Before software can be shipped, there are also such issues such as the hardware cost, dependencies, and portability. To avoid hardware provisioning becoming a problem during the software development cycle, increasing use is being made of virtualization.

Virtualization allows several applications to be hosted concurrently, each of them using a small proportion of the physical resources that are available, on the same physical machine. Several guest machines, can be deployed on the host machines as Virtual Machines (VMs), whatever their operating system. VMs can also help to automate testing by allowing a range of test environments to be created by a script, used to run tests, and then removed. By using VMs on servers, you can make better use of existing hardware, scale them more easily, and make deployment simpler. The hypervisor, it turns out, isn’t the most efficient way of using resources. Each virtual machine needs dedicated resources like such as CPU, Memory, Disk etc. but a majority of these resources are used by the hypervisor and the guest machine operating system itself, leaving only a minority available for use by applications.

To overcome some of the limitation of VMs, Containers have become increasingly popular. Like VMs, they can be used locally within an intranet, or in the cloud like Azure. Containers are quicker to start up, and avoid most of the the processing and storage overhead by instead using the process and file system isolation features of the Linux kernel to expose only kernel features to a container that is otherwise isolated from other processes. Containers allow developers to build applications directly on the host operation system without the need of the Hypervisor or VMs. To the application, the container seems to be a fully-isolated and independent OS. Although containerization has been a part of Linux for a long time, it is only fairly recently that, by creating a common toolset, packaging model and deployment mechanism, Docker has made it far simpler to containerize and distribute applications that can then run anywhere on any Linux host.

Microsoft has added support to its Azure cloud platform that allows Docker containers to have data volumes that are separate from their host. The move makes it easier to migrate containers between hosts, according to the firm, and further demonstrates Microsoft's new-found enthusiasm for open source technology. The latest support comes in the shape of the Docker Volume Plugin for Azure File Storage, the latter being Microsoft's cloud-based managed file share service based on the standard SMB 3.0 protocol that it introduced on Azure last autumn. The open source Docker plugin allows Docker containers to have data volumes that are stored outside of the virtual machine they are hosted on, and therefore makes it easy to migrate containers between hosts while preserving their state intact.

Docker uses Linux containers to publish the application on the host machine. The host machine can be any well-known Linux distribution such as Ubuntu. Docker can be installed on Windows or MAC host machine within a Linux virtual machine (or "VM") installed on it. Multiple containers can be created on the host machine and will run Linux-based applications independently within each container. For example, we can bring up three local MySQL Servers on three different containers and run an application against them.

Docker is not a hypervisor and does not need dedicated physical resources. The Docker Engine provides application platforms called containers which isolate code, runtime, system resource, supporting/dependent binaries and libraries to run the applications. The container itself is the small basic version of Linux OS which runs on the host machine. Containers can be installed with any necessary supporting tool, libraries, code to run the application. These containers allows developers to build applications, image, and ship to any other host machine to run independently. Because it has all the supporting tools and libraries within the image, there will be no configuration required on the new host machine.

docker

Docker Components

Before we take a more practical approach, there is some jargon that I’ll need to introduce:

  • Docker Engine or Daemon: The Docker Daemon is a Linux-based engine which runs on any a Linux host machine.

  • Docker Client: The Docker Client is the command line interface (CLI) to interact with the Docker Daemon. We will discuss the different Docker clients in later part of the article.

  • Docker Container: The Docker Container is the isolated Linux platform with all the necessary tools readily available like operation system, applications, supporting libraries etc. for developers to start building and running the application.

  • Docker Image: The Docker Image is the snapshot of the container that is created from containers. It is the complete read-only environment with base operation system, applications, supporting libraries etc. and can be readily shipped and deployed in any other host machine.

  • Docker Hub Repository: This is the repository to store and share images. Images can be stored in both public and private repositories.

  • Dockerfile: DockerFile helps to automate the image creation process from Docker container.

To get to the point of being able to install Docker containers on Windows Azure, you must have a Docker that can host containers for your applications on Azure. Before we can do that, we need to create an Azure Docker VM extension to the Azure Linux Agent. There are two ways to create Docker VM Extension using Windows Azure:

Deploying Docker VM Extension using Azure Marketplace

Deploying Docker VM Extension using Azure portal or Command-Line (CLI),

We’ll concentrate only on Deploying Docker VM Extension using Azure Marketplace, because this is quick and easy to setup and configure. Deploying Docker VM Extension using Azure portal or CLI is a more complex and lengthy process that is described here.

The Docker VM Extension can be easily created using the ‘Docker on Ubuntu Server’ Azure Marketplace image. This image contains Ubuntu LTSserver with Docker VM extension and latest Docker Engine pre-installed. This imaged is created and published on the Azure Marketplace by Canonical in collaboration with Microsoft. Creating Docker VM Extension using Azure market place image is quick, easy and it can be done in just few steps:

Installing the Docker Virtual Machine

  1. Login to the http://portal.azure.com
  2. Click on New > Create > Compute > Marketplace > everything.
  3. Search for ‘Docker on Ubuntu Server’ then click ‘Create’ button in the right corner.
  4. Provide the hostname, username, password and optionally other settings such as Server configuration and location could be specified. Finally click on ‘Create’ to create a new Ubuntu server with Docker VM Extension.
  5. The New virtual machine creation process will take some time but finally, the Docker VM running status should show up the icon pinned at the starboard of the Azure portal.
Read more articles on Azure: