Skip to content
Philip Callender edited this page Mar 26, 2016 · 6 revisions

Back: Docker related Topics       Next: How Docker helps development

The Problem

In the past, software development required installing various software packages on your development machine. At Twist Resources we use multiple database vendors (MySql, Oracle, Postgres, MSSql), (REDIS for caching, Solr for search, Selenium for testing, numerous logging and metrics collecting tools, and whatever else might be required by a project.

Installing all this software takes a lot of time, and often creates version dependencies as a developer moves from project to project. Worse still, these products sometimes behave differently in production to how they work on a development machine, making bugs appear for the first time in production. Such bugs are notoriously difficult to track down.

The Solution

Docker provides a solution for these problems. From the Docker website:

Docker containers wrap up a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in.

https://www.docker.com/what-docker

Get that? A Docker container effectively1 carries it's operating system and everything else it requires with it.

Rather than installing a bunch of different software packages on your machine, you run a bunch of Docker Containers - one for each software package. Because they each bring everything they need with them, and they run independently, there is no chance of them being installed incorrectly or having a clash with other software installed on the same machine.

Old:

PICTURE

New:

PICTURE

Each container can be pulled (downloaded) from a remote server with a simple command, and then run with another command. There is no need to actually install the software - you simply refer to it by name.

$ docker pull solr mysql
$ docker run solr
$ docker run mysql

The amazing thing about Docker is that after the initial pull request, the container can be started up in a fraction of a second.

No installation, no dependencies, starts in seconds? Really?
yes.

The container images may be slow to download the first time. The good news however, is that an incremental backup, if you need to download an updated version of the image later only the changes are downloaded 2.

The benefits for us

What this means for us:

  1. We no longer need to install that databases and other packages we use during application development.

  2. A simply configuration file can define what is required, and the appropriate containers will be downloaded and started as required. The same config can be used by all developers, ensuring they have exactly the same versions.

  3. Docker ensures that a container running on one machine using Docker will run exactly the same as on any other machine with Docker. If we package our application as a Docker container on an iMac, it will run exactly the same on a linux server for QA, staging or production.


1 Up above I say effectively because Docker containers don't really contain a complete operating system installation in each container. By the magic of Docker however they do appear to, and as a user of Docker containers you don't particularly need to know how this works, but if you are curious a quick search online will find an endless supply of information about Docker.

2 Pull requests are incremental only to an extent. It depends on how the image has been created and what has been changed. Search Google for details.

Clone this wiki locally