Over a million developers have joined DZone.

8 Docker Deployment Patterns

DZone's Guide to

8 Docker Deployment Patterns

· Cloud Zone
Free Resource

MongoDB Atlas is a database as a service that makes it easy to deploy, manage, and scale MongoDB. So you can focus on innovation, not operations. Brought to you in partnership with MongoDB.

 I recently came across an interesting blog post that pulls together some different Docker design patterns that you might find useful. Vidar Hokstad wrote this blog article, and he has quite a bit of experience with Docker, especially in using Docker to create repeatable builds without data loss. His experience with Docker makes his curation of these patterns all that much more valuable. He sums up his central purpose pretty clearly:

The examples Dockerfiles below are all focused on that: Creating containers where the containers themselves can be replaced at any time without having to think about it.

The more regularly the containers are recreated; the more habitual this becomes, the more it reinforces a habit of avoiding state outside of clearly defined locations that are explicitly persisted.
Hokstad's list of patterns includes:
  1.  The Shared Base Container(s)
  2. The Shared Volume Dev Container
  3. The Dev Tools Container
  4. The Test in a Different Environment Containers
  5. The Build Container
  6. The Installation Container
  7. The Default-Service-in-a-Box Containers
  8. The Infrastructure / Glue Containers
For a detailed look at what comprises these Docker patterns, including code to get your started, read Hokstad's full blog article.

MongoDB Atlas is the best way to run MongoDB on AWS — highly secure by default, highly available, and fully elastic. Get started free. Brought to you in partnership with MongoDB.


Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}