Skip to content

Commit 7cb59fe

Browse files
committed
Install PostGIS version of PostgreSQL.
1 parent 18220a2 commit 7cb59fe

15 files changed

+30
-171
lines changed

9.0/Dockerfile renamed to 9.0-2.1/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A4
2525

2626
ENV PG_MAJOR 9.0
2727
ENV PG_VERSION 9.0.22-1.pgdg80+1
28+
ENV PGIS_MAJOR 2.1
29+
ENV PGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1
2830

2931
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list
3032

3133
RUN apt-get update \
3234
&& apt-get install -y postgresql-common \
3335
&& sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \
3436
&& apt-get install -y \
35-
postgresql-$PG_MAJOR=$PG_VERSION \
37+
postgresql-$PG_MAJOR-postgis-$PGIS_MAJOR=$PGIS_VERSION \
3638
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
3739
&& rm -rf /var/lib/apt/lists/*
3840

File renamed without changes.

9.1/Dockerfile renamed to 9.1-2.1/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A4
2525

2626
ENV PG_MAJOR 9.1
2727
ENV PG_VERSION 9.1.18-1.pgdg80+1
28+
ENV PGIS_MAJOR 2.1
29+
ENV PGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1
2830

2931
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list
3032

3133
RUN apt-get update \
3234
&& apt-get install -y postgresql-common \
3335
&& sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \
3436
&& apt-get install -y \
35-
postgresql-$PG_MAJOR=$PG_VERSION \
37+
postgresql-$PG_MAJOR-postgis-$PGIS_MAJOR=$PGIS_VERSION \
3638
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
3739
&& rm -rf /var/lib/apt/lists/*
3840

File renamed without changes.

9.2/Dockerfile renamed to 9.2-2.1/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A4
2525

2626
ENV PG_MAJOR 9.2
2727
ENV PG_VERSION 9.2.13-1.pgdg80+1
28+
ENV PGIS_MAJOR 2.1
29+
ENV PGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1
2830

2931
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list
3032

3133
RUN apt-get update \
3234
&& apt-get install -y postgresql-common \
3335
&& sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \
3436
&& apt-get install -y \
35-
postgresql-$PG_MAJOR=$PG_VERSION \
37+
postgresql-$PG_MAJOR-postgis-$PGIS_MAJOR=$PGIS_VERSION \
3638
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
3739
&& rm -rf /var/lib/apt/lists/*
3840

File renamed without changes.

9.3/Dockerfile renamed to 9.3-2.1/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A4
2525

2626
ENV PG_MAJOR 9.3
2727
ENV PG_VERSION 9.3.9-1.pgdg80+1
28+
ENV PGIS_MAJOR 2.1
29+
ENV PGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1
2830

2931
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list
3032

3133
RUN apt-get update \
3234
&& apt-get install -y postgresql-common \
3335
&& sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \
3436
&& apt-get install -y \
35-
postgresql-$PG_MAJOR=$PG_VERSION \
37+
postgresql-$PG_MAJOR-postgis-$PGIS_MAJOR=$PGIS_VERSION \
3638
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
3739
&& rm -rf /var/lib/apt/lists/*
3840

File renamed without changes.

9.4/Dockerfile renamed to 9.4-2.1/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A4
2525

2626
ENV PG_MAJOR 9.4
2727
ENV PG_VERSION 9.4.4-1.pgdg80+1
28+
ENV PGIS_MAJOR 2.1
29+
ENV PGIS_VERSION 2.1.7+dfsg-3~94.git954a8d0.pgdg80+1
2830

2931
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list
3032

3133
RUN apt-get update \
3234
&& apt-get install -y postgresql-common \
3335
&& sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \
3436
&& apt-get install -y \
35-
postgresql-$PG_MAJOR=$PG_VERSION \
37+
postgresql-$PG_MAJOR-postgis-$PGIS_MAJOR=$PGIS_VERSION \
3638
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
3739
&& rm -rf /var/lib/apt/lists/*
3840

File renamed without changes.

9.5/Dockerfile

Lines changed: 0 additions & 50 deletions
This file was deleted.

9.5/docker-entrypoint.sh

Lines changed: 0 additions & 109 deletions
This file was deleted.

Dockerfile.template

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys B97B0AFCAA1A4
2525

2626
ENV PG_MAJOR %%PG_MAJOR%%
2727
ENV PG_VERSION %%PG_VERSION%%
28+
ENV PGIS_MAJOR %%PGIS_MAJOR%%
29+
ENV PGIS_VERSION %%PGIS_VERSION%%
2830

2931
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list
3032

3133
RUN apt-get update \
3234
&& apt-get install -y postgresql-common \
3335
&& sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \
3436
&& apt-get install -y \
35-
postgresql-$PG_MAJOR=$PG_VERSION \
37+
postgresql-$PG_MAJOR-postgis-$PGIS_MAJOR=$PGIS_VERSION \
3638
postgresql-contrib-$PG_MAJOR=$PG_VERSION \
3739
&& rm -rf /var/lib/apt/lists/*
3840

generate-stackbrew-library.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@ set -e
33

44
declare -A aliases
55
aliases=(
6-
[9.4]='9 latest'
6+
[9.4-2.1]='9-2 9 latest'
77
)
88

99
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
1010

1111
versions=( */ )
1212
versions=( "${versions[@]%/}" )
13-
url='git://github.com/docker-library/postgres'
13+
url='git://github.com/docker-library/postgres-postgis'
1414

1515
echo '# maintainer: InfoSiftr <github@infosiftr.com> (@infosiftr)'
1616

1717
for version in "${versions[@]}"; do
1818
commit="$(cd "$version" && git log -1 --format='format:%H' -- Dockerfile $(awk 'toupper($1) == "COPY" { for (i = 2; i < NF; i++) { print $i } }' Dockerfile))"
19-
fullVersion="$(grep -m1 'ENV PG_VERSION ' "$version/Dockerfile" | cut -d' ' -f3 | cut -d- -f1 | sed 's/~/-/g')"
20-
versionAliases=( $fullVersion $version ${aliases[$version]} )
19+
pgFullVersion="$(grep -m1 'ENV PG_VERSION ' "$version/Dockerfile" | cut -d' ' -f3 | cut -d- -f1 | sed 's/~/-/g')"
20+
pgisFullVersion="$(grep -m1 'ENV PGIS_VERSION ' "$version/Dockerfile" | cut -d' ' -f3 | cut -d+ -f1 | sed 's/~/-/g')"
21+
versionAliases=( $pgFullVersion-$pgisFullVersion $version ${aliases[$version]} )
2122

2223
echo
2324
for va in "${versionAliases[@]}"; do

update.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@ packages="$(echo "$packagesUrl" | sed -r 's/[^a-zA-Z.-]+/-/g')"
1414
curl -sSL "${packagesUrl}.bz2" | bunzip2 > "$packages"
1515

1616
for version in "${versions[@]}"; do
17-
fullVersion="$(grep -m1 -A10 "^Package: postgresql-$version\$" "$packages" | grep -m1 '^Version: ' | cut -d' ' -f2)"
17+
splitPos=$(expr index "$version" '-')
18+
pgVersion=${version:0:$(($splitPos - 1))}
19+
pgFullVersion="$(grep -m1 -A10 "^Package: postgresql-$pgVersion\$" "$packages" | grep -m1 '^Version: ' | cut -d' ' -f2)"
20+
pgisVersion=${version:$splitPos}
21+
pgisFullVersion="$(grep -m1 -A10 "^Package: postgresql-$pgVersion-postgis-$pgisVersion\$" "$packages" | grep -m1 '^Version: ' | cut -d' ' -f2)"
1822
(
1923
set -x
2024
cp docker-entrypoint.sh Dockerfile.template "$version/"
2125
mv "$version/Dockerfile.template" "$version/Dockerfile"
22-
sed -i 's/%%PG_MAJOR%%/'$version'/g; s/%%PG_VERSION%%/'$fullVersion'/g' "$version/Dockerfile"
26+
sed -i 's/%%PG_MAJOR%%/'$pgVersion'/g; s/%%PG_VERSION%%/'$pgFullVersion'/g' "$version/Dockerfile"
27+
sed -i 's/%%PGIS_MAJOR%%/'$pgisVersion'/g; s/%%PGIS_VERSION%%/'$pgisFullVersion'/g' "$version/Dockerfile"
2328
)
2429
done
2530

0 commit comments

Comments
 (0)