postgresql - Trying to create postgis inside docker file gives the error -


here command i'm trying run.

i'm using official postgres docker image. can't find info 'is not database cluster directory'

step 7 : run pg_ctl start -w &&     createdb postgis_template -e utf8 &&    psql -d postgis_template -c "create extension if not exists postgis;" &&    pg_ctl stop -w      ---> running in da5745cab398     pg_ctl: directory "/var/lib/postgresql/data" not database cluster directory 

you're getting error because there no database cluster created inside postgres docker image when you're attempting run pg_ctl start command.

the database cluster created when run docker container based on image, initdb binary called part of docker-entrypoint.sh script set entrypoint postgres container.

if you're running postgres container mounted data volume persistent across container restarts, can run command once psql shell, or can override docker-entrypoint.sh script , add own custom 1 creates postgis extension.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -