2.6 KiB
Why Docker?
The original "Docker pitch" (back in 2013!) made a lot of comparisons with the shipping industry, and its transformation thanks to the intermodal shipping container.
More than a decade later... Why is Docker still relevant, and what are we using it for?
Escape dependency hell
-
Write installation instructions into an
INSTALL.txtfile -
Using this file, write an
install.shscript that works for you -
Turn this file into a
Dockerfile, test it on your machine -
If the Dockerfile builds on your machine, it will build anywhere
-
Rejoice as you escape dependency hell and "works on my machine"
Never again "worked in dev - ops problem now!"
On-board developers and contributors rapidly
-
Write Dockerfiles for your application components
-
Use pre-made images from the Docker Hub (mysql, redis...)
-
Describe your stack with a Compose file
-
On-board somebody with two commands:
git clone ...
docker compose up
With this, you can create development, integration, QA environments in minutes!
class: extra-details
Implement reliable CI easily
-
Build test environment with a Dockerfile or Compose file
-
For each test run, stage up a new container or stack
-
Each run is now in a clean environment
-
No pollution from previous tests
Way faster and cheaper than creating VMs each time!
class: extra-details
Use container images as build artefacts
-
Build your app from Dockerfiles
-
Store the resulting images in a registry
-
Keep them forever (or as long as necessary)
-
Test those images in QA, CI, integration...
-
Run the same images in production
-
Something goes wrong? Rollback to previous image
-
Investigating old regression? Old image has your back!
Images contain all the libraries, dependencies, etc. needed to run the app.
class: extra-details
Devs vs Ops, before Docker
-
Drop a tarball (or a commit hash) with instructions.
-
Dev environment very different from production.
-
Ops don't always have a dev environment themselves ...
-
... and when they do, it can differ from the devs'.
-
Ops have to sort out differences and make it work ...
-
... or bounce it back to devs.
-
Shipping code causes frictions and delays.
class: extra-details
Devs vs Ops, after Docker
-
Drop a container image or a Compose file.
-
Ops can always run that container image.
-
Ops can always run that Compose file.
-
Ops still have to adapt to prod environment, but at least they have a reference point.
-
Ops have tools allowing to use the same image in dev and prod.
-
Devs can be empowered to make releases themselves more easily.