diff --git a/Dockerfile b/Dockerfile index 6bdc4fe..db20bea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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-10.0 postgresql-common postgresql-10.0 postgresql-10.0-postgis-2.4 postgresql-10.0-pgrouting netcat # Open port 5432 so linked containers can see them EXPOSE 5432 diff --git a/build.sh b/build.sh index 04cbca8..113ae58 100755 --- a/build.sh +++ b/build.sh @@ -1 +1 @@ -docker build -t kartoza/postgis:9.6-2.4 . +docker build -t kartoza/postgis:10.0-2.4 . diff --git a/setup.sh b/setup.sh index 2a9a8ae..fdf56ed 100755 --- a/setup.sh +++ b/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/10.0/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/10.0/main/pg_hba.conf +echo "host all all 172.18.0.0/16 md5" >> /etc/postgresql/10.0/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/10.0/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/10.0/main/postgresql.conf +echo "port = 5432" >> /etc/postgresql/10.0/main/postgresql.conf # Enable ssl diff --git a/start-postgis.sh b/start-postgis.sh index cb81e42..20b9002 100755 --- a/start-postgis.sh +++ b/start-postgis.sh @@ -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/10.0/main" +CONF="/etc/postgresql/10.0/main/postgresql.conf" +POSTGRES="/usr/lib/postgresql/10.0/bin/postgres" +INITDB="/usr/lib/postgresql/10.0/bin/initdb" +SQLDIR="/usr/share/postgresql/10.0/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/10.0-main.pg_stat_tmp +chmod 0777 /var/run/postgresql/10.0-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/10.0/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/10.0-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/10.0-main.pid 2>/dev/null)" ]; do sleep 1 done