Skip to content

Docker

Our microservices are built according to 12factor principles - docker allows us to take advantage of this by letting us tag individual commits/artifacts and promote them throughout our environments without having to recompile.

Docker is a containerization API that lets us sandbox applications into distributable images that contain all the necessary dependencies for the app to run. By wrapping all of the application dependencies into the same image, we can ensure that if all tests pass on an image locally, they will pass in all environments (provided there aren't any configuration issues). This also allows for near-instant rollbacks should a deploy ever go in a bad direction, since as long as you have the image from the version prior it will continue to work in the same way once it is re-deployed.

Hosting

We host all of our images on DockerHub using the private repository settings. This is probably one of the weaker links in our stack, as dockerhub has gone down before and if dockerhub is down, our k8s pods will be unable to pull images.

!! This should probably be resolved by either switching off the pullImage: always in the k8s config or using our own cache server for our docker images. (pullImage:always is a relic of when we used to use the same tag over and over instead of always pushing to a new tag)

Resources

Good resource on a high level view of docker Learn Docker in 12 Minutes