In 2013 Dotcloud released Docker.
The Betabrand use case for Docker was immediately obvious. I saw it as the solution to simplify our development and staging environments; by getting rid of the ansible scripts (well, almost; more on that later).
Those scripts would now only be used for production.
At the time, one main pain point for the team was competing for our three physical staging servers: dev1, dev2 and dev3; and for me maintaining those 3 servers was a major annoyance.
After observing docker for a few months, I decided to give it a go in April 2014.
After installing docker on one of the staging servers, I created a single docker image containing our entire stack (haproxy, varnish, redis, apache, etc.) then over the next few months wrote a tool (
sailor) allowing us to create, destroy and manage an infinite number of staging environment accessible via individual unique URLs.
Worth noting that docker-compose didn’t exist at that time; and that putting your entire stack inside one docker image is of course a big no-no but that’s an unimportant detail here.
From this point on, the team wasn’t competing anymore for access to the staging servers. Anybody could create a new, fully configured, staging container from the docker image using sailor. I didn’t need to maintain the servers anymore either; better yet, I shut down and cancelled 2 of them.
Our development environment, however, still was running on macos (well, "Mac OS X" at the time) and using the Ansible scripts.
Then, sometime around 2016 docker-machine was released.
Docker machine is a tool taking care of deploying a docker daemon on any stack of your choice: virtualbox, aws, gce, bare-metal, azure, you name it, docker-machine does it; in one command line.
I saw it as the opportunity to easily and quickly migrate our ansible-based development environment to a docker based one. I modified
sailor to use docker-machine as its backend.
Setting up a development environment was now a matter of creating a new docker-machine then passing a flag for sailor to use it.
At this point, our development-staging process had been simplified tremendously; at least from a dev-ops perspective: anytime I needed to upgrade any software of our stack to a newer version or change the configuration, instead of modifying my ansible scripts, asking all the team to run them, then running them myself on all 3 staging servers; I could now simply push a new docker image.
Ironically enough, I ended up needing virtual machines (which I had deliberately avoided) to run docker on our macbooks. Using vagrant instead of Ansible would have been a better choice from the get go. Hindsight is always 20/20.
Using docker for our development and staging systems paved the way to the better solution that Betabrand.com now runs on.