postgresql/README.md: Mention volume-mounts and setup
authorW. Trevor King <wking@tremily.us>
Fri, 27 Dec 2013 21:43:21 +0000 (13:43 -0800)
committerW. Trevor King <wking@tremily.us>
Thu, 2 Jan 2014 02:03:32 +0000 (18:03 -0800)
Without a host-mounted volume for /var/lib/postgresql I filled up the
10GB dm block allocated by Docker v0.7.2.

postgresql/README.md

index ea70519d55ad7e9d823347bb65b4b5e5b1dea26e..065e6e68e7dcc0fae86a63adcf8cb3f9648a109c 100644 (file)
@@ -46,5 +46,22 @@ You can also access it from unlinked containers:
 Basically, anyone with access to the `docker0` bridge has access to
 the client's port.
 
+If you're going to be loading a large database ([devicemapper only
+supports 16GB][devicemapper-size-limit]), you may want to
+[volume-mount] the database.  Grab the configured stuff we'll want to
+mount:
+
+    # docker run -d -name postgresql-0 wking/postgresql
+    # docker cp postgresql-0:/var/lib/postgresql/ /var/lib/
+    # mv /var/lib/postgresql/ /var/lib/postgresql-0
+    # docker kill postgresql-0
+    # docker rm postgresql-0
+
+And run future containers with:
+
+    $ docker run -d -name postgresql-0 -v /var/lib/postgresql-0:/var/lib/postgresql wking/postgresql
+
 [PostgreSQL]: http://postgresql.io/
 [linking]: http://docs.docker.io/en/latest/use/port_redirection/#linking-a-container
+[devicemapper-size-limit]: https://www.kernel.org/doc/Documentation/device-mapper/thin-provisioning.txt
+[volume-mount]: http://docs.docker.io/en/latest/use/working_with_volumes/#mount-a-host-directory-as-a-container-volume