DevOps Playground #9 – Hands on with Docker

Martin Coxall 24th January 2017

Welcome to 2017 and our 9th DevOps playground! Our topic to kick-start the new year: Docker. Speaker and guide for the evening’s whistle-stop tour of concepts, best practices, and beer – Disney DevOps engineer Simon Witheridge!

What is Docker?

A leading software containerisation platform, Docker software allows businesses to package applications into standardised units for software development. These packages, better known as ‘containers’, are an isolated, lightweight way of encapsulating and distributing an application, along with all its needed libraries, dependencies and configurations.

Hands on with Docker

Our evening began with Simon using a small virtual machine, created by Hashicorp’s Vagrant, to demonstrate and describe how to “Dockerise” an application. This is a surprisingly simple process that involves getting an application to run inside one or more Docker containers. The example application used – Gitbook – takes various flavours of Markdown and renders them as beautiful HTML for serving via a web server.

Then, following a broad discussion on topics including what Dockerfiles are, how to create a Docker image and how to run them as containers, we watched as Simon built, and used the newly created Gitbook container to serve Gitbook generated HTML, using its own internal web server.

DSC_5990[2].jpg

Best Practice

Not content with his demonstration going so smoothly, and clearly needing to fill some time, Simon decided to throw us a curveball and announced that the steps he had just taken us through weren’t exactly officially recommended. This led to a lively and vocal debate over Dockerfile best practices, e.g. making sure that all dependencies have versions explicitly stated and that your Dockerfiles clean up after themselves, and demonstration on how to complete the previously shown steps using them.

Linking Containers

Finally, to close the evening, we discussed the process of linking two containers, something better completed with Nginx rather than our own internal web server as it already has premade containers. Simon demonstrated how to use shared volumes to share the generated HTML from Gitbook into the document root of Nginx and although the two containers remained separate, they now shared enough data to act like a single application.

Overall, it was a fun and fascinating demonstration of how simple it is to get Docker up and running and we’re very grateful to Simon for his insight. We hope that everyone had a great time, learned something new and, as always, we’d love to hear any idea or suggestions you might have for our next event.

 

Attend our next Meetup – All Hands on DevOps – on Thursday, February 2, 2017, from 7pm. Register here. 

Found this interesting? Why not share it: