0

I try to deploy a container docker-postgis 11 with this command :

It's possible to link two volumes ? or what it's the best way to modify the conf files ( postgresql -pg_hba.conf) Thank you

docker run -d \
-v $HOME/postgres_data/data:/var/lib/postgresql \
-v $HOME/postgres_data/conf:/etc/postgresql/11/main \
-p 5433:5432 \
--name=testpostgis \
-e POSTGRES_USER="gis" \
-e POSTGRES_PASS="gis" \
-e POSTGRES_DBNAME="gis" \
-d kartoza/postgis:11.0-2.5

But when i link the second volume , the container not restart My goal it' have the possiblility to modify the conf file

1

1 Answer 1

1

The rigth way to modify the inside configuration of a base image is building it from Dockerfile like this:

FROM kartoza/postgis:11.0-2.5

COPY $HOME/postgres_data/conf /etc/postgresql/11/main

ENTRYPOINT /docker-entrypoint.sh

Then run:

docker run -d \
-v $HOME/postgres_data/data:/var/lib/postgresql \
-p 5433:5432 \
--name=testpostgis \
-e POSTGRES_USER="gis" \
-e POSTGRES_PASS="gis" \
-e POSTGRES_DBNAME="gis" \
-d kartoza/postgis:11.0-2.5 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.