From the postgis/postgis:13-3.1-alpine docker image I can push 3 shapefiles into my database using shp2pgsql
in an init script.
But from the postgis/postgis:13-3.1 image I cannot:
(...)
db_1 | /docker-entrypoint-initdb.d/11_init.sh: 19: /docker-entrypoint-initdb.d/11_init.sh: shp2pgsql: not found
db_1 | /docker-entrypoint-initdb.d/11_init.sh: 20: /docker-entrypoint-initdb.d/11_init.sh: shp2pgsql: not found
db_1 | /docker-entrypoint-initdb.d/11_init.sh: 21: /docker-entrypoint-initdb.d/11_init.sh: shp2pgsql: not found
Both PostgreSQL and PostGIS version are however the same.
If it was designed for a specific purpose, why and which one?
Tip: to the present day (20210114), as an inelegant workaround is to install... the postgis
apt package itself (yes, it sounds funky but it actually fixes the missing shp2pgsql
binary)!
/docker-entrypoint.sh
script and a/docker-entrypoint-initdb.d/
folder with a first init script10_postgis.sh
to actually install all the necessary postgis stuff. So you can plug whatever other script in that folder, following that they will be run in alphabetical order at startup. This is what I actually did to insert data usingshp2pgsql
e.g. You can play with it using:# docker run -it -e POSTGRES_PASSWORD=password postgis/postgis:13-3.1
and then connect to it.