Docker is an open source framework that provides a lighter-weight type of virtualization, using Linux containers rather than virtual machines. Built on traditional Linux distributions such as Red Hat Enterprise Linux and Ubuntu, Docker lets you package applications and services as images that run in their own portable containers and can move between physical, virtual, and cloud foundations without requiring any modification. If you build a Docker image on an Ubuntu laptop or physical server, you can run it on any compatible Linux, anywhere.
In this way, Docker allows for a very high degree of application portability and agility, and it lends itself to highly scalable applications. However, the nature of Docker also leans toward running a single service or application per container, rather than a collection of processes, such as a LAMP stack. That is possible, but we will detail here the most common use, which is for a single process or service.
Thus, in this guide, we'll install the Apache Web server into a Docker container and investigate how Docker operates along the way.
We'll use Ubuntu as the foundation of our Docker build. The Docker team itself uses Ubuntu for development, and Docker is supported on Ubuntu Server 12.04, 13.04, 13.10, and 14.04. The installation steps are slightly different for each version, so we will cover them all here.
From a fresh installation of Ubuntu 12.04, we will need to follow these steps to make sure we have the proper kernel version and associated headers:
$ sudo apt-get update
$ sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring