kartoza/docker-postgis

Wrong value for var DEFAULT_SCRIPTS_LOCKFILE_DIR

vidlb opened this issue · 2 comments

What is the bug or the crash?

The default value here

DEFAULT_SCRIPTS_LOCKFILE_DIR="/docker-entrypoint.initdb.d"
is different that the one in the docs (or the official postgres image), it should be docker-entrypoint-initdb.d.
This results in a lockfile created in the wrong path, thus it won't get cached in case this directory is used as a volume.

Steps to reproduce the issue

echo "create table test (gid integer);" > setup-db.sql
docker run --name testdb -d -v `pwd`/setup-db.sql:/docker-entrypoint-initdb.d/setup-db.sql kartoza/postgis:16
docker exec testdb ls -A /docker-entrypoint-initdb.d
# setup-db.sql
docker exec testdb ls -A /docker-entrypoint.initdb.d
# .entry_point.lock

Versions

Starting from 14 to latest, 13 isn't affected

Additional context

This only problematic if like me you're trying to mount a directory of sql scripts as a volume to this target dir, and want to preserve the lockfile in future containers where pgdata volume already exists (in order to avoid re-init db).