Get started with Docker on Azure for Microsoft developers and/or Linux noobs

I said it earlier in a previous post. The world is changing. And especially the world of Microsoft Developers. In my post about modern tools I presented a list with tools that a developers must have in his toolbox. This list did not contain a lot of Microsoft tools.

In the ALM space, and here I focus on Team Foundation Server (TFS) and Visual Studio Online (VSO) a lot of things are changing too. TFS and VSO become more and more open with REST API’s, allowing companies to integrate and connect with their own (non-microsoft tool). In my posts about integrating TeamCity with TFS You can see a vivid example of this.

This post is about Docker. Docker is a technology that allows you to run applications within a container. This container contains all settings, prerequisites etc to run your application. This makes a container extremely useful for shipping (hence the metaphor of a container) and is widely used in Continuous Delivery scenarios. Companies like Spotify, Uber and PayPal use Docker to enable their fast delivery of software. The CTO of Docker explains it here on YouTube.

Within the Microsoft space we do not see a lot of usage of Docker containers. This is mostly due to the fact that Windows cannot run Docker containers (yet! Take a look at Windows Nano..). You need to run Linux to be able to run Docker.

Personally I really like the concept of containers. Having everything packed within the container allows companies to move faster towards production. Developers make it work in their container and it runs everywhere. Continuous Delivery, and DevOps practices in action.

So, I wanted to gain some experience with Docker and started to look around for resources. I found the following resources

After following these steps I had quite some insights in how Docker worked. But still, I found it hard to get a grip on how to make stuff really work. After following the ASP.Net series I had the idea that I missed how Docker really worked, So I decided to do it on the native OS, from scratch.

In the rest of this post I will walk you through my steps of creating a Linux machine with Docker, and making it accesible via Remote Desktop. We will use that as the foundation for creating a Docker container with a Visual Studio Build vNext Agent.

 

Getting started

To get started we need a machine to start on. I my case I created a Linux Virtual Machine on Azure. I browsed the internet and found this great tutorial that you can use to create a Linux VM, enable Remote Desktop, install a desktop and open the endpoint in Azure to access this machine.

The steps that you have to take (in short) . Some steps (marked bold) are different from the tutorial.

  • Log in to your Azure Subscription
  • Create a VM from the gallery and choose Ubuntu Server 14.04! (In the tutorial a 12.05 image is created)image
  • I gave it 3.5 GB RAM (A2 image)
  • Don’t use the SSH key, but provide a password.
  • Create the VM
  • Download Putty ( http://aka.ms/putty )and connect to the VM using the name you provided (name.cloudapp.net)
  • Install the Ubuntu Desktop
  • Install the xRDP protocol
  • Enable the Azure endpoint for Remote Desktop

After finishing these steps, you have a fully functional Azure machine. Only when connecting with Remote Desktop the Ubuntu 14.04 crashes. After researching (a lot !) I found out that the desktop manager of Ubuntu 14.04 does not work anymore with xRDP.

Following this walkthrough (THANKS!) I was able to get a Remote Desktop Connection working for my machine.

When you now open a Remote Desktop Client and connect to your Azure machine you have a fully functional desktop. This makes a lot easier to edit files and copy things around and find stuff on the internet.

image

Setting up Docker

Now we want to run Docker on this machine. I connected with Putty to my machine and followed the steps described in the Docker User Guide.

https://docs.docker.com/installation/ubuntulinux/

With this image, the only thing I needed to do was to run this command

wget – qO – https://get.docker.com/ | sh

 

After that you are able to run Docker containers. If you run the command

sudo docker run hello-world

 

You should see this

image

NB: If you are wondering what sudo means before every command(just like me in the beginning) it means…Super User Do. In other words run this command as Super User. Something like elevated privileges in Windows. If you want to run all docker commands as Super User (or shut down User Account Control in Windows), follow these steps here.

Next Steps

Now you have your Linux machine up and running and Docker installed, I would highly recommend that you follow the instructions in the Docker User Guide. They provide a lot of useful insights in how to work with Docker.

In my next post I will talk about how to create a Docker container which runs a Visual Studio Build vNext agent

Trackbacks/Pingbacks

  1. Running a Visual Studio Build vNext agent in a Docker container | The Road to ALM - August 7, 2015

    […] I needed to set-up my Linux and Docker environment. I described that adventure in my post, [Get started with Docker on Azure for Microsoft Developers and Linux noobs]. After that the building of the Docker container was my next […]

  2. Get started with Docker on Azure for Microsoft developers and/or Linux noobs | Dinesh Ram Kali. - August 15, 2015

    […] https://roadtoalm.com/2015/07/31/get-started-with-docker-on-azure-for-microsoft-developers-andor-linu… […]

  3. Create a Windows Docker Host and connect to it without Visual Studio | The Road to ALM - December 30, 2015

    […] Get started with Docker on Azure for Microsoft developers and/or Linux noobs […]

  4. Running a VS Team Services (VSO) Build Agent in a Windows Docker Container | The Road to ALM - February 15, 2016

    […] Get started with Docker on Azure for Microsoft developers and/or Linux noobs […]

%d bloggers like this: