Over a million developers have joined DZone.

8 Docker Deployment Patterns

· Cloud Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database on AWS. Try it now! 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.

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
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.
Subscribe

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

{{ parent.tldr }}

{{ parent.urlSource.name }}