You can run these three lines on any machine where Docker is installed (Linux,
macOS, Windows), and in a few minutes, you will get the DockerCoins demo app
up and running. DockerCoins was created in 2015; it has multiple components
written in Python, Ruby, and Node.js, as well as a Redis store. Years later,
without changing anything in the code, we can still bring it up with the same
three commands.
This means that onboarding a new team member, or switching from a project
to another, can now be quick and reliable. It doesn’t matter if DockerCoins is
using Python 2.7 and Node.js 8 while your other apps are using Python 3 and
Node.js 10, or if your system is using even different versions of these languages;
each container is perfectly isolated from the others and from the host system.
We will see how to get there.
1.1.2 Deploy Easily in the Cloud or on Premises
After we build container images, we can run them consistently on any server
environment. Automating server installation would usually require steps (and
domain knowledge) specific to our infrastructure. For instance, if we are using
AWS EC2, we may use AMI (Amazon Machine Images), but these images are
different (and built differently) from the ones used on Azure, Google Cloud, or
a private OpenStack cluster.
Configuration management systems (like Ansible, Chef, Puppet, or Salt) help
us by describing our servers and their configuration as manifests that live in
version-controlled source repositories. This helps, but writing these manifests is
no easy task, and they don’t guarantee reproducible execution. These manifests
have to be adapted when switching distributions, distribution versions, and
sometimes even from a cloud provider to another, because they would use
different network interfaces or disk naming, for instance.
Once we have installed the Docker Engine (the most popular option), it can run
any container image and effectively abstract these environment discrepancies.
The ability to stage new environments easily and reliably gives us exactly what
we need to set up CI/CD (continuous integration and continuous delivery). We
will see how to get there. Ultimately, it means that advanced techniques, such
as blue/green deployments, or immutable infrastructure, become accessible to
us, instead of being a privilege of larger organizations able to spend a lot of
time to build their perfect custom tooling.
12