kopia lustrzana https://github.com/kartoza/docker-postgis
Update build for 9.5
rodzic
9987840ec4
commit
b4d733eb2f
|
@ -18,7 +18,7 @@ RUN apt-get -y update
|
|||
# We add postgis as well to prevent build errors (that we dont see on local builds)
|
||||
# on docker hub e.g.
|
||||
# The following packages have unmet dependencies:
|
||||
RUN apt-get install -y postgresql-client-9.6 postgresql-common postgresql-9.6 postgresql-9.6-postgis-2.4 postgresql-9.6-pgrouting netcat
|
||||
RUN apt-get install -y postgresql-client-9.5 postgresql-common postgresql-9.6 postgresql-9.6-postgis-2.4 postgresql-9.6-pgrouting netcat
|
||||
|
||||
# Open port 5432 so linked containers can see them
|
||||
EXPOSE 5432
|
||||
|
|
2
build.sh
2
build.sh
|
@ -1 +1 @@
|
|||
docker build -t kartoza/postgis:9.6-2.4 .
|
||||
docker build -t kartoza/postgis:9.5-2.4 .
|
||||
|
|
12
setup.sh
12
setup.sh
|
@ -2,16 +2,16 @@
|
|||
chmod 600 /etc/ssl/private/ssl-cert-snakeoil.key
|
||||
|
||||
# These tasks are run as root
|
||||
CONF="/etc/postgresql/9.6/main/postgresql.conf"
|
||||
CONF="/etc/postgresql/9.5/main/postgresql.conf"
|
||||
|
||||
# Restrict subnet to docker private network
|
||||
echo "host all all 172.17.0.0/16 md5" >> /etc/postgresql/9.6/main/pg_hba.conf
|
||||
echo "host all all 172.18.0.0/16 md5" >> /etc/postgresql/9.6/main/pg_hba.conf
|
||||
echo "host all all 172.17.0.0/16 md5" >> /etc/postgresql/9.5/main/pg_hba.conf
|
||||
echo "host all all 172.18.0.0/16 md5" >> /etc/postgresql/9.5/main/pg_hba.conf
|
||||
# And allow access from DockerToolbox / Boottodocker on OSX
|
||||
echo "host all all 192.168.0.0/16 md5" >> /etc/postgresql/9.6/main/pg_hba.conf
|
||||
echo "host all all 192.168.0.0/16 md5" >> /etc/postgresql/9.5/main/pg_hba.conf
|
||||
# Listen on all ip addresses
|
||||
echo "listen_addresses = '*'" >> /etc/postgresql/9.6/main/postgresql.conf
|
||||
echo "port = 5432" >> /etc/postgresql/9.6/main/postgresql.conf
|
||||
echo "listen_addresses = '*'" >> /etc/postgresql/9.5/main/postgresql.conf
|
||||
echo "port = 5432" >> /etc/postgresql/9.5/main/postgresql.conf
|
||||
|
||||
# Enable ssl
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
# This script will run as the postgres user due to the Dockerfile USER directive
|
||||
|
||||
DATADIR="/var/lib/postgresql/9.6/main"
|
||||
CONF="/etc/postgresql/9.6/main/postgresql.conf"
|
||||
POSTGRES="/usr/lib/postgresql/9.6/bin/postgres"
|
||||
INITDB="/usr/lib/postgresql/9.6/bin/initdb"
|
||||
SQLDIR="/usr/share/postgresql/9.6/contrib/postgis-2.2/"
|
||||
DATADIR="/var/lib/postgresql/9.5/main"
|
||||
CONF="/etc/postgresql/9.5/main/postgresql.conf"
|
||||
POSTGRES="/usr/lib/postgresql/9.5/bin/postgres"
|
||||
INITDB="/usr/lib/postgresql/9.5/bin/initdb"
|
||||
SQLDIR="/usr/share/postgresql/9.5/contrib/postgis-2.2/"
|
||||
LOCALONLY="-c listen_addresses='127.0.0.1, ::1'"
|
||||
|
||||
# /etc/ssl/private can't be accessed from within container for some reason
|
||||
|
@ -18,8 +18,8 @@ rm -r /etc/ssl
|
|||
mv /tmp/ssl-copy /etc/ssl
|
||||
|
||||
# Needed under debian, wasnt needed under ubuntu
|
||||
mkdir -p /var/run/postgresql/9.6-main.pg_stat_tmp
|
||||
chmod 0777 /var/run/postgresql/9.6-main.pg_stat_tmp
|
||||
mkdir -p /var/run/postgresql/9.5-main.pg_stat_tmp
|
||||
chmod 0777 /var/run/postgresql/9.5-main.pg_stat_tmp
|
||||
|
||||
# test if DATADIR is existent
|
||||
if [ ! -d $DATADIR ]; then
|
||||
|
@ -71,7 +71,7 @@ fi
|
|||
# Usage is: docker run [...] -e ALLOW_IP_RANGE='192.168.0.0/16'
|
||||
if [ "$ALLOW_IP_RANGE" ]
|
||||
then
|
||||
echo "host all all $ALLOW_IP_RANGE md5" >> /etc/postgresql/9.6/main/pg_hba.conf
|
||||
echo "host all all $ALLOW_IP_RANGE md5" >> /etc/postgresql/9.5/main/pg_hba.conf
|
||||
fi
|
||||
|
||||
# redirect user/pass into a file so we can echo it into
|
||||
|
@ -139,11 +139,11 @@ fi
|
|||
# This should show up in docker logs afterwards
|
||||
su - postgres -c "psql -l"
|
||||
|
||||
PID=`cat /var/run/postgresql/9.6-main.pid`
|
||||
PID=`cat /var/run/postgresql/9.5-main.pid`
|
||||
kill -TERM ${PID}
|
||||
|
||||
# Wait for background postgres main process to exit
|
||||
while [ "$(ls -A /var/run/postgresql/9.6-main.pid 2>/dev/null)" ]; do
|
||||
while [ "$(ls -A /var/run/postgresql/9.5-main.pid 2>/dev/null)" ]; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue