Link two volumes, container not start

by fansz   Last Updated May 16, 2019 06:26 AM

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



Answers 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 
Sergio Alexander Florez
Sergio Alexander Florez
May 16, 2019 06:24 AM

Related Questions


Updated October 29, 2018 14:26 PM

Updated June 28, 2017 11:26 AM

Updated July 04, 2017 14:26 PM

Updated August 28, 2018 00:26 AM

Updated May 20, 2015 03:11 AM