0

Almost the same as Import osm data in Docker postgresql BUT I want to load the osm data into the postgres via osm2pgsql during the docker build phase.

The reason for this are:

  1. I only want to load a fixed osm file inside my postgres, meaning this data will not change.
  2. I want to reuse this docker image as many times as possible.
  3. It is not possible to mount any volume with my current environment.

I know that this will make the docker image big but that is something I already took into consideration.

mateeyow
  • 1,306
  • 1
  • 17
  • 38
  • don't you need data persistence? – Stefano Oct 11 '19 at 07:58
  • Yes, I want to save the data along with the docker image – mateeyow Oct 11 '19 at 09:38
  • but the data is inside the docker image. Once you build and destroy a docker container, all data that went inside that specific container after the creation will be lost unless you use a volume but in that case you're going to lose the initial set of data you defined during the build phase – Stefano Oct 11 '19 at 10:26
  • Not really, if during the build phase the data is saved on the postgres volume without mounting anything then it will be saved there permanently. Docker images are more or less the same as snapshots for VMs – mateeyow Oct 11 '19 at 14:18
  • maybe when https://github.com/moby/moby/issues/14080 is accepted but up to then you can't mount volumes during build time – Stefano Oct 11 '19 at 14:23

0 Answers0