When should I use Docker?

A fictional dialog.

The Uninformed: You must use Docker, I know we are only a team of 5, but everyone else is using it!

Developer: But we are building a simple service, which will bring us excellent value, we need to ship now.

The Uninformed: Sorry, we build everything using Docker, however as we haven’t got any infrastructure in place, you will have to wait a few months.

The Informed: Don’t use Docker! We need to provide value before we even need to consider using something complex like Docker.

The Informed: We are going to make the operational decision that all new services in our business, which will be deployed to our new infrastructure, will be required to use Docker. Our platform is ready to go; the added benefit of security and consistent environments allow us to ensure what is tested in our continuous delivery pipeline is the same as what is deployed.

Developer: That makes sense, however I seem to find my development workflow has been impacted, and I am less productive than I used to be.

The Informed: This is a downside of using tooling at this stage. You do not need to use Docker at all points of development, it really depends on what guarantees you want to have. Do you want to be able to rapidly iterate, with the possibility that what you deploy is not the same as what you have tested? If so, you might spend days debugging a minor patch version change in a module you are using. Or do you want to be able to have a slightly slower iteration, run everything through a continuous delivery pipeline and be ensured that what you are testing is guaranteed to be the same in production?

As you can see from the above, using Docker can be as much a business decision as a technical one. We need to make informed decisions on when to use certain technologies, and Docker is definitely one of these.

As developers, from front-end to back-end, from SREs to infrastructure the choices we make impact, more than the immediate problem. We need to ensure that the due diligence has been carried out and it is up to us to be as informed as we can.

But really, when should I not use Docker?

If your company already has a deployment pipeline, with immutable hashed assets being passed through, deployed to infrastructure that isolates binaries from each other and the host, then the cost to migrate to using Docker would likely not be justified. This thinking also applied on the other-side of the operational spectrum; if deploying a single application to production is needed quickly and your company has limited operational knowledge.

But please, ignore me if you must. Just make the right choice for you and your business.