mediagis / nominatim-docker

100% working container for Nominatim
Creative Commons Zero v1.0 Universal
1.07k stars 437 forks source link

Exporting Docker container does not come with database #472

Open IndigoCurnick opened 11 months ago

IndigoCurnick commented 11 months ago

Describe the bug I'm trying to export the Docker container with a built Nomaintim database inside. I can create the container as described in the readme. I can also stop that container and run it again without issues. However, when I export it and then create a new container from the export I get errors related to needing to specify PBF_URL.

You need to specify either the PBF_URL or PBF_PATH environment variable
docker run -e PBF_URL=https://download.geofabrik.de/europe/monaco-latest.osm.pbf ...
docker run -e PBF_PATH=/nominatim/data/monaco-latest.osm.pbf ...

However, if I look inside the tar file I export I can see that the database is present. I would expect it to not need these flags as I don't want it to rebuild the database.

Related to #343

To Reproduce

Create the initial Nominatim container

docker run -it --shm-size=1g \
  -e PBF_URL=https://download.geofabrik.de/europe/monaco-latest.osm.pbf \
  -e REPLICATION_URL=https://download.geofabrik.de/europe/monaco-updates/ \
  -e IMPORT_WIKIPEDIA=false \
  -e NOMINATIM_PASSWORD=very_secure_password \
  -v nominatim-data:/var/lib/postgresql/14/main \
  -p 8080:8080 \
  --name nominatim \
  mediagis/nominatim:4.2

Export to a gzip file

docker export nominatim | gzip > nominatim.gz

Import, use a different name for clarity

zcat nominatim.gz | docker import - nom

Create the container

docker run -p 8080:8080 -t nom /app/start.sh

Expected behavior The Docker container to load with the already built

Desktop / Server (please complete the following information):