Why Docker made me love Packer

I'll start out by being honest and possibly a little hurtful. I love everything that Hashicorp has been putting out, but when I first read about Packer my first thought was "Okay, so what's the point?"

Unlike more senior people, I earned my baptism in the operations world exclusively through the use of config management tools like Chef or Ansible. In this world, the concept of a "golden image" is sacrilege. Your machines are supposed to be ordinary cattle, not a sacred cow. You should feel free to create, change, and destroy them on a whim. Packer appeared to be a tool focused on facilitating the creation of Golden Images. A useful tool certainly, but it supported a system that was slowly becoming obsolete. 

Fast forward about a year. After giving in and trying out the container craze that is surrounding Docker, I found that config management has taken an interesting twist. Rather than have a litany of VM's that can be configured and destroyed, it is now simplified into containers that can be spun up and destroyed on a whim. You could have hundreds of different containers on a single system operating independently, all built from base Docker images. At the core of these base images is the principle of "immutable infrastructure", or images that should not be altered.

Sounds a lot like another Golden Image, doesn't it?

Well guess what?  It is, and it's a perfect partner to Packer. 

(Oh yeah, this is the general reaction happening around Docker right now...)

While there are plenty of questions of how to use Docker in a production setup, the big question that people are asking is how to implement the creation of containers into a continuous delivery system? How do you manage the versioning and creation of containers? How do you manage installing the data you want on the containers and pump it into your code pipeline?

With Packer managing that, this would seem to be a much more simplified solution. As a build step in your cd pipeline, have Packer create a docker image with the newest version of your software on it, and push it to an artifact storage system of choice. You could setup tags to do version pinning, configure it with the base software, and it would all be done as code. at that point, the setup of a new app server is as simple as pulling down the latest image. I don't know if this system was a case of brilliant planning by Hashicorp, or simply a fortunate accident, but I would imagine that this will be a pattern that becomes vogue pretty shortly

How to set this up from end to end? Still working on that part, but I expect it will be fun.