Open OptiMael opened 1 year ago
I was able to reproduce this.
# import
docker run --rm -e UPDATES=enabled -e THREADS=2 -v osm-data:/data/database/ overv/openstreetmap-tile-server import
# run in background
docker run -d --name osm --rm -e UPDATES=enabled -e THREADS=2 -v osm-data:/data/database/ overv/openstreetmap-tile-server run
# change the update script to write the THREADS env to a debug file instead
docker exec osm bash -c "echo 'echo \${THREADS:-default} >/tmp/debugenv' >/usr/bin/openstreetmap-tiles-update-expire.sh"
# wait a minute for crontab to execute the script
# output the contents of the debug file
docker exec osm bash -c "cat /tmp/debugenv"
This outputs default
instead of 2
.
Workaround that results in 2
being written to the file instead of default
:
docker exec osm bash -c "printenv >/etc/environment"
printenv >/etc/environment
could be added to the run.sh
here between line 174 and 175:
https://github.com/Overv/openstreetmap-tile-server/blob/6088b9b37f440f141f643f413a3d6454a1c01aa2/run.sh#L174-L175
I define some environment variables in
docker-compose.yml
(e.g.THREADS=8
) which get used correctly for setting uprenderd.conf
https://github.com/Overv/openstreetmap-tile-server/blob/6088b9b37f440f141f643f413a3d6454a1c01aa2/run.sh#L171But the
openstreetmap-tiles-update-expire.sh
executed via Cron doesn't have access to the enviroment variables. This results in execution ofopenstreetmap-tiles-update-expire.sh
with default parameters.