Docker is poised to become one of the most widely used virtualization methods. It uses Linux containers to separate application data and the underlying infrastructure on shared resources, rather than virtual machines. Docker automates the deployment any application as a portable, self sufficient container that can run almost anywhere – even Microsoft Azure.
Microsoft Azure offers VM Extensions that are compatible with Azure Virtual Machines. These extensions can be developed by Microsoft or trusted third-party suppliers. VM extensions allow for security, runtime debugging, management, as well as other dynamic features that can be used to maximize the productivity of Virtual machines. Azure Virtual Machine Agent allows you to install, configure and manage VM Extensions. You can configure VM agents and VM extensions during VM creation, or on an existing VM. This can be done via the Management Portal, PowerShell cmdlets, or xplat cli.
Using a Docker VM Extension and the Azure Linux Agent, we can create a Docker VM to host any number of containers for your Azure applications. The Docker VM Extension offers many cool features, including Docker Hub integration, Docker Compose support, and Docker Registry authentication support.
Azure portal allows you to create Docker VM extensions
Here are the steps to create a Docker VM extension via the Azure preview portal.
You will need to use utilities
Create an Ubuntu server
Docker can be installed on your client machine
Docker certificates
Add Docker VM Extension
Add the Docker communication endpoint
Test your Docker host running on Azure VM
You will need to use utilities:
An Azure account
A 64-bit preferably Linux client machine, Curl installed
Step 1: Create an Ubuntu server 14.04 virtual machine from gallery
Azure, being Microsoft, supports open source technologies. You can also create VMs with Linux flavors.
These Ubuntu servers are supported to install Docker:
Ubuntu 15.04
Ubuntu 14.04 (LTS).
Ubuntu 12.04 (LTS).
Ubuntu 13.10
Log in to Azure preview portal and click on New (+), browse compute. At the marketplace, select Ubuntu Server 14.04 LTS. Click Create. Complete all details and click on Create.
Step 2: Install Docker onto your client machine
You need Docker installed on your client machine to generate certificates (my client machine is Ubuntu 14.04). Curl is required to download and set up Docker. Curl is used to transfer data from and to a server.
Note: Check if curl is installed.$ which curlIf not installed then install it after updating the manager:$ sudo apt-get update$ sudo apt-get install curlRun the below command to install Docker $ curl -sSL https://get.docker.com/ | shCheck if the Docker got installed properly:$ sudo docker run hello-world12345678910111213Note: Check if curl is installed.$ which curlIf not installed then install it after updating the manager:$ sudo apt-get update$ sudo apt-get install curlRun the below command to install Docker $ curl -sSL https://get.docker.com/ | shCheck if the Docker got installed properly:$ sudo docker run hello-world
Step 3: Create Docker certificates
To allow your client computer to communicate with Azure hosts using https, we must create a self-signed CA certificate, Server certificate, and a key.
Generate CA public and private keys:$ openssl generator -aes256; -out CA-key.pem 4096$ openedsl req-new x509 –days 365 –key ca-key.pem; -sha256; -out CA.pemCreate server key and certificate signing request. As server FQDN, provide “Common Name” (CN). This is the hostname that you will use for Docker.