I've been watching Docker ever since Flynn was announced, and started using it seriously this last December. Primarily, I'm trying to use it as a faster alternative to Chef/Puppet, running it over a Vagrant precise64 box, to potentially be something I can shove onto a foreign machine without much worry.<p>Overall, this has actually worked fairly well- getting certain containers up and running, and having them work together, hasn't been very difficult. But, there's one place that's consistently been a thorn in my side: PostgreSQL.<p>Currently, there is this article in Docker.io's docs[1] that claims to help you set up a Postgres container, but so far I've not seen it work for me or anyone else I've spoken to about it. It's primarily come from how Postgres is traditionally installed/ran:<p>1. Service is started. This can either be an 'active' Postgres server, or in the background. This creates a Postmaster.pid file, which ensures no other Postgres servers are running on the machine(I'm not entirely sure why, beyond ease-of-use scenarios).<p>2. Service is stopped. This deletes the Postmaster.pid file.<p>In the case of Docker containers, this presents a bit of a problem. If you try to start the Postgres container that way, it will run, but the Postmaster.pid seems to sit outside of it. In the process, once you shut that container down, you actually can't start another without error- the Postmaster.pid stops you.<p>The other alternative, is having a container running with Postgres as a background process to something else. This can work, but you start having to use services that can keep a process running while letting you access /bin/bash to still get at Postgres.<p>Neither of these potential solutions allow you to retain data, either.<p>I've done a lot of poking around, but I haven't had a lot of success in figuring out how to get past this. Those who are using Docker as a Puppet/Chef replacement, especially with Vagrant- what are you usually doing for a database solution?<p>1. <a href="http://docs.docker.io/en/latest/examples/postgresql_service/" rel="nofollow">http://docs.docker.io/en/latest/examples/postgresql_service/</a>