postgresql: Declare /var/lib/postgresql a VOLUME
authorW. Trevor King <wking@tremily.us>
Thu, 2 Jan 2014 06:23:41 +0000 (22:23 -0800)
committerW. Trevor King <wking@tremily.us>
Thu, 2 Jan 2014 16:46:12 +0000 (08:46 -0800)
commitf6feceb9f1db730d3b87020f9d2115a34599b5cf
tree9f998e1e316a9d33606f9ea6d429db24cd2859c0
parent484b4e2bffec074e6af9f28afb52cf9154fca8d9
postgresql: Declare /var/lib/postgresql a VOLUME

Avoid the hassle of maintaining a host-mounted volume by letting
Docker handle the volume maintenance ;).  We need to declare the
VOLUME *after* filling it with content (with 'emerge --config'),
otherwise ownership and permissions on the empty volume are lost
[1,2,3], and future RUN commands die due to:

  initdb: could not access directory "/var/lib/postgresql/9.3/data": Permission denied

[1]: https://github.com/dotcloud/docker/issues/2360
[2]: https://github.com/dotcloud/docker/issues/2969
[3]: https://github.com/dotcloud/docker/issues/2975
[4]: https://github.com/dotcloud/docker/pull/3008
postgresql/Dockerfile.template
postgresql/README.md