Here’s just some of the stuff I had to learn, use & research in 2017…
Running Docker, or specifically running Docker on your Windows 10 machine, sounds simple? Well yes in the most part it is, Docker provide an installer and setup to do just that.
So what’s the issue? Well, ‘Docker for Windows’ is pretty flaky; sometimes won’t start for no apparent reason and installing it often fails. Chatting to colleagues at work and on Twitter several people have had problems with it, usually just before they are running a live demo - the last thing you want to be worrying about before a demo is “will Docker fall over?”
Now I’m not sure what the root of these problems is, but I thought I’d examine some of the alternatives. These alternatives all forgo installing the regular ‘Docker for Windows’ setup on your machine. I will also be ignoring the need to run Windows Containers, as we’ve already got enough to discuss.
The tools were are interested in are the following commands: docker, docker-compose and docker-machine
NOTE the default install options with ‘Docker Toolbox’ include a lot of rubbish you don’t need, like VirtualBox (blergh) and Kitematic, be sure to deselect those options and just install ‘Docker Client’, ‘Docker Compose’ and ‘Docker Machine’
Docker client tools for WSL bash
If you are using Windows Subsystem for Linux (WSL) and bash you will want to use the Docker tools from there too. There is no client only package that Docker provide for Linux, however the binaries are available.
Running the following snippet in a WSL bash terminal will download and install the tools you need.
OK with the client tools installed, we need some machine or VM running the Docker engine (I’ll refer to this as a Docker host)
Your choices here fall into two options; run a VM locally or run a VM in the cloud, we’ll discus both here.
Your next decision is how to build the VM and install Docker, as we’re in DIY mode, the temptation is to create the Linux VM yourself (e.g. Ubuntu) and then install Docker on it. DO NOT DO THIS! This is way, way more pain than it worth, you will spend an inordinate amount of time with configuration; iptables, daemon.json, etc and at the end of it all have an insecure Docker instance.
The ‘Docker Machine’ tool was created for a good reason, so we should use it. Docker Machine will create the Docker host VM for us, install the Docker engine securely and give us a clean simple way to point our tools to the new VM
Running Docker Machine
Docker Machine will let us create our host either in the cloud or locally. This is done via different drivers, there are a wide range of drivers we will look at two, Azure and Hyper-V
Creating Docker host in Azure
This is a simple process, just a single command docker-machine create -d azure. You will need your Azure subscription ID (easily found in the Azure portal) and that’s about it. The following is a bare bones but functioning example
My second technical primer, this one covers containers & Docker. Aimed at people that want to understand containers, what they are, how to use them and also get started with Docker. The guide goes into medium technical depth, examples of commands but is not intended as a comprehensive end to end reference.
As usual, these can be used for presentations, used in labs & exercises but also given as handout/reading material.
This is a follow up to my first post on running Node.js in Azure App Service, this time I want to cover the newly GA’ed App Service on Linux. In most regards App Service on Linux works the same way as the regular (Windows) App Service, is has the same core features and operate mostly the same.
The main difference (aside from the blindingly obvious; the host OS is Linux!) is App Service on Linux uses Docker containers to host & run your webapp. This provides a heap of advantages when it comes to deploying your app, and IMO containers also make an ideal way to run Node based apps. There’s many lightweight and robust Docker images you can use, the Alpine Linux image notably weighing in at a tiny 23MB.
You have two fundamental ways of working with App Service on Linux:
Use one of the provided application stack images Referred to as “App Service on Linux” or “Linux Web Apps”
Run a custom image, either one of your own Docker images or one pulled from Dockerhub. Referred to as “Web App for Containers”
We’ll cover using both approaches to host and run Node apps
I’ve decided to put a few of my technical guides online, I’ve called these guides “technical primers”, created with technical folks in mind, that might be new to a particular topic or domain. I wanted to solve several things with these primers, combining both introductory overview content, but also technical reference material and deeper dives into various key areas. These can be used for presentations, used in labs & exercises but also given as handout/reading material.
I’ve been using Node.js quite a lot lately as I find it a nice quick way to get web projects started easily, and one of the things I’ve been doing is deploying and running my Node.js apps in Azure. Azure provides a number of ways of to run Node.js code within the platform, but I’ll be focusing on the PaaS Azure App Services or Web Apps (more info), rather than VMs or anything strange.
Why write a blog about this? Isn’t using Node.js with Azure Web Apps all easy and already documented? Well… kinda, there is documentation but there’s also a lot of gotchas, semi-hidden features and things I stumbled across which made me feel like gathering all these nuggets of info into one place
In my previous post I mentioned a hands on lab covering ‘DevOps in Azure with OpenSource’. I’ve done a live demo and run through of this which goes into a little more detail and covers things like infrastructure as code and the Azure CLI. The demo is about 40 minutes (sorry there’s a lot to cover !) check it out below:
I’ve recently put together a couple of training labs / hackathon exercises. One is based on the .NET Core series of posts but updated slightly and made into more of a single logical flow, it also adds CI/CD to the process using Visual Studio Team Services (VSTS). The basic premise behind both is the same; starting from scratch writing a web application and getting it deployed into Azure via VSTS. The second lab uses Node.js as the application stack instead of .NET Core, and deploys into Azure Linux Web Apps (rather than Docker Machine) via Docker containers.
These guides can be used a number of ways; run as a demo, given to people to run through at a hackathon or as a training exercise
Since I moving my blog into Azure (as detailed in a previous post), I had started to see a series of odd alerts being fired out, with lots of random 500 errors at odd times of the day & night. When I checked the website was fine. At first thought this was related to the Azure App Service I was hosting my site in, but it occurred to me that it could have been happening before, but I just didn’t know - Azure & the App Service was alerting me to stuff I previously had no visibility into
Recently I decided to move my Wordpress blog from where it is hosted in a virtual shared Linux environment (TSO Host) into Azure. The current hosting is fine and has served me well over the years, but seeing as my current job is working with Azure I wanted to experiment. In particular my role is focused on the PaaS web & app hosting services in Azure, so I wanted to see first hand what the experience was like, particularly for a non enterprise user.
The migration has been successful (hopefully this page loaded without errors!), so I’ve decided to capture my thoughts on the process and some of the challenges I encountered along the way