Technical questionAccepted answer
Install Postgis in docker container
DatGuy
Sep 1
0 views1
I created a database with Docker using the postgres image as usual
docker run -d \
--name some-postgres \
-e POSTGRES_PASSWORD=mypassword \
-v ${HOME}/postgres-data/:/var/lib/postgresql/data \
-p 5432:5432 \
postgres
now I decided to add a new column in one of the tables to store coordinates using PostGIS, however when I do
CREATE EXTENSION postgis;
or something similar I get this error message:
ERROR: could not open extension control file "/usr/share/postgresql/12/extension/postgis.control": No such file or directory
Is there an additional step one has to take before running the Docker container in order to install PostGIS?
1 answer
Accepted answer · original discussion
w08r
PermalinkSep 1
The postgis extension does not come with vanilla postgres, which does ship with a whole bunch of more general purpose extensions, though nothing notable for geospatial. Take a look at this instead: https://registry.hub.docker.com/r/postgis/postgis/
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.