What do you need to know about docker?
In order to understand the concept behind Docker the first thing to get your head around is the distinction between the Linux kernel and user applications.
The kernel is the software which provides applications with access to your computer’s hardware via drivers and APIs. User applications make use of the kernel to run and include all the software you’d normally use such as:
- web servers such as Apache
- application servers such as PHP
- shells such as BASH
- tools like Git
- email services, etc.
Docker is a tool that wraps up a number of Linux technologies – most notably cgroups and kernel namespaces – in order to isolate bundles of user applications all making shared use of the kernel and divide resources as you see fit. The applications run in an object called a container, which is portable and can be lifted and shifted between servers and desktops with ease.
This handy diagram from Docker’s website explains it best:
So in real terms, what does this do for you? Here’s two example use cases:
A shared web server
Each customer site could have its own independent installation of PHP and MySQL and with resources limited to prevent them using your entire server. No container can have any effect on another container, offering isolation and security against hackers, resource overrun, etc.
Docker has a built in version control and repository system based upon Git. Using this you can push changes to the container to Git on your development environment and pull them down on the live server. On the face of it this sounds like any other use of version control for applications. However the difference in this instance is that your container in Git contains:
- your entire web server and their configuration, not just your code
- your running databases and engines like MySQL, not just the database dumps
- the exact copy of PHP that works in development, not a similar version
Docker is a very powerful culmination of technologies that makes working with these otherwise highly complicated tools simple. It’s also a technology in its infancy, and while it has had wide and rapid adoption, best practice varies greatly from organisation to organisation. If you think Docker could be useful to you get in touch and we’ll be happy to help you get started.