Hi and welcome!

Why Docker? 09-02-2015

dockerdevops

This post is a part of series about Docker.

Few months ago I joined the team, which just started to develop a new project. The project was pretty standard for Java world: Java 7, Maven, Jenkins, Tomcat, ESB (Enterprise Service Bus), PostgreSQL, etc…

When I started, the team already had the following:

  • Few environments: demo and stable;

  • ESB with few external integrations and REST API;

  • WEB application distributed as WAR and deployed to Tomcat server;

  • Manual builds in Jenkins and automated deployment with bash scripts;

  • And, of course, a bunch of "How to" pages in Redmine.

The project had few problems and challenges:

  • There were few applications hard to configure. And each developer was forced to configure them individually on his development environment. So, of course, we had a WIKI page - "How to setup development environment", and no one know if the page was up to date;

  • Customer requested us to switch ESB implementation and the migration process seemed scary;

  • We were about to launch public Beta and we have had to build new environment in EC2;

  • In demo and stable environments we used Ubuntu 14.04, but customer asked to use RHEL6.5 in beta.

And to resolve all these problems we decided to try Docker. And I get the job :)

So, how Docker can help to resolve described problems?

  • You can hide applications setup and configuration complexity with Docker images. One person in a team can prepare image with PostgreSQL and others can simply run this image and do not care about configuration and setup;

  • You do not need to describe in WIKI how to install all these applications and systems - everything is described in Dockerfiles;

  • You get exactly the same environment and setup in dev, test and production with Docker containers;

  • It becomes a lot easier to distribute your app. Everything you need to run your app is packaged in Docker image. So if host has Docker installed, then it can run your app. And you do not care if host has correct Java version or some specific library or program installed;

  • You can develop your application in OS you know and run it everywhere. For example you can create Docker image based on Debian, but run it in RedHat or CentOS, or any other Linux system which supports Docker;

  • It is a lot easier to test and develop distributed systems. For example, you can run a cluster of MongoDB in one host and check how the data is distributed and replicated. Or you can run few web servers and load balancer and check how LB routes your requests.

  • It is a lot easier to try things. You create a Docker image, play with it and throw away, and your host system stays clean and calm.

Also we had following requirements:

  • It should be really easy for others members in the team to start work with Docker. We did not want to force everybody in team to learn Docker and became Docker experts;

  • Docker integration should not break existing development process;

  • Docker should be integrated into our existing Maven build;

  • We should have private Docker registry to store our images;

  • Our applications should work nicely in Ubuntu and RHEL;

  • ESB migration should be trivial and transparent for others members of the team;

Keeping all that in mind I started to dig and experiment…