From e2971da001b64a54b4a971ecc83ad9a86ad25387 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 23 Jun 2014 10:03:54 -0600 Subject: [PATCH 01/42] Initial Dockerfile installing from http://apt.postgresql.org --- Dockerfile | 29 +++++++++++++++++++++++++++++ docker-entrypoint.sh | 18 ++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 Dockerfile create mode 100755 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000..ec9073542d96b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM debian:wheezy + +# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added +RUN groupadd -r postgres && useradd -r -g postgres postgres + +RUN apt-get update && apt-get install -y curl + +RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.0/gosu' \ + && chmod +x /usr/local/bin/gosu + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' > /etc/apt/sources.list.d/pgdg.list \ + && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ + | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 + +RUN apt-get update \ + && apt-get install -y postgresql-common \ + && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ + && apt-get install -y postgresql-9.3 + +ENV PATH /usr/lib/postgresql/9.3/bin:$PATH +ENV PGDATA /var/lib/postgresql/data +VOLUME /var/lib/postgresql/data + +ADD ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 0000000000000..5868bad075fef --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +if [ "$1" = 'postgres' ]; then + chown -R postgres "$PGDATA" + + if [ -z "$(ls -A "$PGDATA")" ]; then + gosu postgres initdb + + sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf + + { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + fi + + exec gosu postgres "$@" +fi + +exec "$@" From fa36941d6835d8cd86f891d44fcf2c634ee261c2 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 15 Jul 2014 17:05:42 -0600 Subject: [PATCH 02/42] Move Dockerfile and docker-entrypoint.sh into 9.3 folder to make way for multiple simultaneous supported versions --- Dockerfile => 9.3/Dockerfile | 0 docker-entrypoint.sh => 9.3/docker-entrypoint.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Dockerfile => 9.3/Dockerfile (100%) rename docker-entrypoint.sh => 9.3/docker-entrypoint.sh (100%) diff --git a/Dockerfile b/9.3/Dockerfile similarity index 100% rename from Dockerfile rename to 9.3/Dockerfile diff --git a/docker-entrypoint.sh b/9.3/docker-entrypoint.sh similarity index 100% rename from docker-entrypoint.sh rename to 9.3/docker-entrypoint.sh From 77b5f005d45f4b0747f5a719f329499b6ad454dc Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 15 Jul 2014 17:06:30 -0600 Subject: [PATCH 03/42] Update "gosu" to 1.1 --- 9.3/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/9.3/Dockerfile b/9.3/Dockerfile index ec9073542d96b..f9ef0aab6d497 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -5,7 +5,7 @@ RUN groupadd -r postgres && useradd -r -g postgres postgres RUN apt-get update && apt-get install -y curl -RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.0/gosu' \ +RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ && chmod +x /usr/local/bin/gosu RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' > /etc/apt/sources.list.d/pgdg.list \ From 9375cde5569bcfbe814a2788d97c1f8f9590e514 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 15 Jul 2014 17:06:42 -0600 Subject: [PATCH 04/42] Install an explicit version of Postgres --- 9.3/Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/9.3/Dockerfile b/9.3/Dockerfile index f9ef0aab6d497..1c71b45793a68 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -12,12 +12,15 @@ RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' > /etc/ && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 +ENV PG_MAJOR 9.3 +ENV PG_VERSION 9.3.4-1.pgdg70+1 + RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ - && apt-get install -y postgresql-9.3 + && apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION -ENV PATH /usr/lib/postgresql/9.3/bin:$PATH +ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data From 2bfa44dab27b6be46333ac7bf86f2517c1479090 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 15 Jul 2014 18:14:06 -0600 Subject: [PATCH 05/42] Move things around so 9.4 can be consistent with 9.3 --- 9.3/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/9.3/Dockerfile b/9.3/Dockerfile index 1c71b45793a68..c706046bd334c 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -8,13 +8,13 @@ RUN apt-get update && apt-get install -y curl RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ && chmod +x /usr/local/bin/gosu -RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' > /etc/apt/sources.list.d/pgdg.list \ - && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ - | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 - ENV PG_MAJOR 9.3 ENV PG_VERSION 9.3.4-1.pgdg70+1 +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ + && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ + | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 + RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ From 6fabe2e39c165dd1e2e32f8b758f2c02ded20d8f Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Tue, 15 Jul 2014 18:14:33 -0600 Subject: [PATCH 06/42] add beta version 9.4 --- 9.4/Dockerfile | 32 ++++++++++++++++++++++++++++++++ 9.4/docker-entrypoint.sh | 18 ++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 9.4/Dockerfile create mode 100755 9.4/docker-entrypoint.sh diff --git a/9.4/Dockerfile b/9.4/Dockerfile new file mode 100644 index 0000000000000..dbc3a8c72b9df --- /dev/null +++ b/9.4/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:wheezy + +# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added +RUN groupadd -r postgres && useradd -r -g postgres postgres + +RUN apt-get update && apt-get install -y curl + +RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && chmod +x /usr/local/bin/gosu + +ENV PG_MAJOR 9.4 +ENV PG_VERSION 9.4~beta1-2.pgdg70+1 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ + && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ + | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 + +RUN apt-get update \ + && apt-get install -y postgresql-common \ + && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ + && apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION + +ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH +ENV PGDATA /var/lib/postgresql/data +VOLUME /var/lib/postgresql/data + +ADD ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh new file mode 100755 index 0000000000000..5868bad075fef --- /dev/null +++ b/9.4/docker-entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +if [ "$1" = 'postgres' ]; then + chown -R postgres "$PGDATA" + + if [ -z "$(ls -A "$PGDATA")" ]; then + gosu postgres initdb + + sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf + + { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + fi + + exec gosu postgres "$@" +fi + +exec "$@" From 415b445c37de1d70cf6a669bd48b915952561f7d Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 15 Jul 2014 18:18:44 -0600 Subject: [PATCH 07/42] Add 9.2 --- 9.2/Dockerfile | 32 ++++++++++++++++++++++++++++++++ 9.2/docker-entrypoint.sh | 18 ++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 9.2/Dockerfile create mode 100755 9.2/docker-entrypoint.sh diff --git a/9.2/Dockerfile b/9.2/Dockerfile new file mode 100644 index 0000000000000..ec10dcf34495e --- /dev/null +++ b/9.2/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:wheezy + +# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added +RUN groupadd -r postgres && useradd -r -g postgres postgres + +RUN apt-get update && apt-get install -y curl + +RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && chmod +x /usr/local/bin/gosu + +ENV PG_MAJOR 9.2 +ENV PG_VERSION 9.2.8-1.pgdg70+1 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ + && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ + | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 + +RUN apt-get update \ + && apt-get install -y postgresql-common \ + && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ + && apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION + +ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH +ENV PGDATA /var/lib/postgresql/data +VOLUME /var/lib/postgresql/data + +ADD ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh new file mode 100755 index 0000000000000..5868bad075fef --- /dev/null +++ b/9.2/docker-entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +if [ "$1" = 'postgres' ]; then + chown -R postgres "$PGDATA" + + if [ -z "$(ls -A "$PGDATA")" ]; then + gosu postgres initdb + + sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf + + { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + fi + + exec gosu postgres "$@" +fi + +exec "$@" From ea490430aabd553f34656e8f0e846d2ed3c42930 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 15 Jul 2014 18:27:13 -0600 Subject: [PATCH 08/42] Add 9.1, 9.0, and 8.4 --- 8.4/Dockerfile | 32 ++++++++++++++++++++++++++++++++ 8.4/docker-entrypoint.sh | 18 ++++++++++++++++++ 9.0/Dockerfile | 32 ++++++++++++++++++++++++++++++++ 9.0/docker-entrypoint.sh | 18 ++++++++++++++++++ 9.1/Dockerfile | 32 ++++++++++++++++++++++++++++++++ 9.1/docker-entrypoint.sh | 18 ++++++++++++++++++ 6 files changed, 150 insertions(+) create mode 100644 8.4/Dockerfile create mode 100755 8.4/docker-entrypoint.sh create mode 100644 9.0/Dockerfile create mode 100755 9.0/docker-entrypoint.sh create mode 100644 9.1/Dockerfile create mode 100755 9.1/docker-entrypoint.sh diff --git a/8.4/Dockerfile b/8.4/Dockerfile new file mode 100644 index 0000000000000..3e7263a78a1f6 --- /dev/null +++ b/8.4/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:wheezy + +# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added +RUN groupadd -r postgres && useradd -r -g postgres postgres + +RUN apt-get update && apt-get install -y curl + +RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && chmod +x /usr/local/bin/gosu + +ENV PG_MAJOR 8.4 +ENV PG_VERSION 8.4.21-1.pgdg70+1 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ + && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ + | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 + +RUN apt-get update \ + && apt-get install -y postgresql-common \ + && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ + && apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION + +ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH +ENV PGDATA /var/lib/postgresql/data +VOLUME /var/lib/postgresql/data + +ADD ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/8.4/docker-entrypoint.sh b/8.4/docker-entrypoint.sh new file mode 100755 index 0000000000000..5868bad075fef --- /dev/null +++ b/8.4/docker-entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +if [ "$1" = 'postgres' ]; then + chown -R postgres "$PGDATA" + + if [ -z "$(ls -A "$PGDATA")" ]; then + gosu postgres initdb + + sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf + + { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + fi + + exec gosu postgres "$@" +fi + +exec "$@" diff --git a/9.0/Dockerfile b/9.0/Dockerfile new file mode 100644 index 0000000000000..17564e8d66cd7 --- /dev/null +++ b/9.0/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:wheezy + +# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added +RUN groupadd -r postgres && useradd -r -g postgres postgres + +RUN apt-get update && apt-get install -y curl + +RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && chmod +x /usr/local/bin/gosu + +ENV PG_MAJOR 9.0 +ENV PG_VERSION 9.0.17-1.pgdg70+1 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ + && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ + | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 + +RUN apt-get update \ + && apt-get install -y postgresql-common \ + && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ + && apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION + +ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH +ENV PGDATA /var/lib/postgresql/data +VOLUME /var/lib/postgresql/data + +ADD ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/9.0/docker-entrypoint.sh b/9.0/docker-entrypoint.sh new file mode 100755 index 0000000000000..5868bad075fef --- /dev/null +++ b/9.0/docker-entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +if [ "$1" = 'postgres' ]; then + chown -R postgres "$PGDATA" + + if [ -z "$(ls -A "$PGDATA")" ]; then + gosu postgres initdb + + sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf + + { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + fi + + exec gosu postgres "$@" +fi + +exec "$@" diff --git a/9.1/Dockerfile b/9.1/Dockerfile new file mode 100644 index 0000000000000..f6e8596f0c89b --- /dev/null +++ b/9.1/Dockerfile @@ -0,0 +1,32 @@ +FROM debian:wheezy + +# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added +RUN groupadd -r postgres && useradd -r -g postgres postgres + +RUN apt-get update && apt-get install -y curl + +RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && chmod +x /usr/local/bin/gosu + +ENV PG_MAJOR 9.1 +ENV PG_VERSION 9.1.13-1.pgdg70+1 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ + && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ + | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 + +RUN apt-get update \ + && apt-get install -y postgresql-common \ + && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ + && apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION + +ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH +ENV PGDATA /var/lib/postgresql/data +VOLUME /var/lib/postgresql/data + +ADD ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh new file mode 100755 index 0000000000000..5868bad075fef --- /dev/null +++ b/9.1/docker-entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +if [ "$1" = 'postgres' ]; then + chown -R postgres "$PGDATA" + + if [ -z "$(ls -A "$PGDATA")" ]; then + gosu postgres initdb + + sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf + + { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + fi + + exec gosu postgres "$@" +fi + +exec "$@" From 7c8e945a80097e80fa1c8d69d2a027145177b701 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Wed, 30 Jul 2014 15:22:30 -0600 Subject: [PATCH 09/42] version bumps --- 8.4/Dockerfile | 2 +- 9.0/Dockerfile | 2 +- 9.1/Dockerfile | 2 +- 9.2/Dockerfile | 2 +- 9.3/Dockerfile | 2 +- 9.4/Dockerfile | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/8.4/Dockerfile b/8.4/Dockerfile index 3e7263a78a1f6..845c39b567dee 100644 --- a/8.4/Dockerfile +++ b/8.4/Dockerfile @@ -9,7 +9,7 @@ RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/dow && chmod +x /usr/local/bin/gosu ENV PG_MAJOR 8.4 -ENV PG_VERSION 8.4.21-1.pgdg70+1 +ENV PG_VERSION 8.4.22-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ diff --git a/9.0/Dockerfile b/9.0/Dockerfile index 17564e8d66cd7..438a52a98da47 100644 --- a/9.0/Dockerfile +++ b/9.0/Dockerfile @@ -9,7 +9,7 @@ RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/dow && chmod +x /usr/local/bin/gosu ENV PG_MAJOR 9.0 -ENV PG_VERSION 9.0.17-1.pgdg70+1 +ENV PG_VERSION 9.0.18-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ diff --git a/9.1/Dockerfile b/9.1/Dockerfile index f6e8596f0c89b..894a169f4d8b1 100644 --- a/9.1/Dockerfile +++ b/9.1/Dockerfile @@ -9,7 +9,7 @@ RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/dow && chmod +x /usr/local/bin/gosu ENV PG_MAJOR 9.1 -ENV PG_VERSION 9.1.13-1.pgdg70+1 +ENV PG_VERSION 9.1.14-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ diff --git a/9.2/Dockerfile b/9.2/Dockerfile index ec10dcf34495e..f2545fff3b404 100644 --- a/9.2/Dockerfile +++ b/9.2/Dockerfile @@ -9,7 +9,7 @@ RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/dow && chmod +x /usr/local/bin/gosu ENV PG_MAJOR 9.2 -ENV PG_VERSION 9.2.8-1.pgdg70+1 +ENV PG_VERSION 9.2.9-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ diff --git a/9.3/Dockerfile b/9.3/Dockerfile index c706046bd334c..6c9336b31502b 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -9,7 +9,7 @@ RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/dow && chmod +x /usr/local/bin/gosu ENV PG_MAJOR 9.3 -ENV PG_VERSION 9.3.4-1.pgdg70+1 +ENV PG_VERSION 9.3.5-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ diff --git a/9.4/Dockerfile b/9.4/Dockerfile index dbc3a8c72b9df..4d303671b09c7 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -9,7 +9,7 @@ RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/dow && chmod +x /usr/local/bin/gosu ENV PG_MAJOR 9.4 -ENV PG_VERSION 9.4~beta1-2.pgdg70+1 +ENV PG_VERSION 9.4~beta2-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ From 6abeb8590f35c5251b9f100a667024febaeee06b Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Wed, 30 Jul 2014 17:19:11 -0600 Subject: [PATCH 10/42] Add in contrib for useful modules --- 8.4/Dockerfile | 4 +++- 9.0/Dockerfile | 4 +++- 9.1/Dockerfile | 4 +++- 9.2/Dockerfile | 4 +++- 9.3/Dockerfile | 4 +++- 9.4/Dockerfile | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/8.4/Dockerfile b/8.4/Dockerfile index 845c39b567dee..9eb88d81de2f9 100644 --- a/8.4/Dockerfile +++ b/8.4/Dockerfile @@ -18,7 +18,9 @@ RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJ RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ - && apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION + && apt-get install -y \ + postgresql-$PG_MAJOR=$PG_VERSION \ + postgresql-contrib-$PG_MAJOR=$PG_VERSION ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data diff --git a/9.0/Dockerfile b/9.0/Dockerfile index 438a52a98da47..bf7e2fb50c53a 100644 --- a/9.0/Dockerfile +++ b/9.0/Dockerfile @@ -18,7 +18,9 @@ RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJ RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ - && apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION + && apt-get install -y \ + postgresql-$PG_MAJOR=$PG_VERSION \ + postgresql-contrib-$PG_MAJOR=$PG_VERSION ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data diff --git a/9.1/Dockerfile b/9.1/Dockerfile index 894a169f4d8b1..9739a5686fc05 100644 --- a/9.1/Dockerfile +++ b/9.1/Dockerfile @@ -18,7 +18,9 @@ RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJ RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ - && apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION + && apt-get install -y \ + postgresql-$PG_MAJOR=$PG_VERSION \ + postgresql-contrib-$PG_MAJOR=$PG_VERSION ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data diff --git a/9.2/Dockerfile b/9.2/Dockerfile index f2545fff3b404..1ddb5f52727d6 100644 --- a/9.2/Dockerfile +++ b/9.2/Dockerfile @@ -18,7 +18,9 @@ RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJ RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ - && apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION + && apt-get install -y \ + postgresql-$PG_MAJOR=$PG_VERSION \ + postgresql-contrib-$PG_MAJOR=$PG_VERSION ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data diff --git a/9.3/Dockerfile b/9.3/Dockerfile index 6c9336b31502b..90a6f347be870 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -18,7 +18,9 @@ RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJ RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ - && apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION + && apt-get install -y \ + postgresql-$PG_MAJOR=$PG_VERSION \ + postgresql-contrib-$PG_MAJOR=$PG_VERSION ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data diff --git a/9.4/Dockerfile b/9.4/Dockerfile index 4d303671b09c7..04eb6b0f3d80e 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -18,7 +18,9 @@ RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJ RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ - && apt-get install -y postgresql-$PG_MAJOR=$PG_VERSION + && apt-get install -y \ + postgresql-$PG_MAJOR=$PG_VERSION \ + postgresql-contrib-$PG_MAJOR=$PG_VERSION ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data From 6b7b3bd6ca3a032f393d52ce72a419235804496f Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 1 Aug 2014 15:15:58 -0600 Subject: [PATCH 11/42] Add a new script to make it trivial and less error-prone to perform a mass version-bump --- Dockerfile.template | 35 +++++++++++++++++++++++++++++++++++ update.sh | 25 +++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 Dockerfile.template create mode 100755 update.sh diff --git a/Dockerfile.template b/Dockerfile.template new file mode 100644 index 0000000000000..02e8f02a2dea5 --- /dev/null +++ b/Dockerfile.template @@ -0,0 +1,35 @@ +# vim:set ft=dockerfile: +FROM debian:wheezy + +# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added +RUN groupadd -r postgres && useradd -r -g postgres postgres + +RUN apt-get update && apt-get install -y curl + +RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && chmod +x /usr/local/bin/gosu + +ENV PG_MAJOR %%PG_MAJOR%% +ENV PG_VERSION %%PG_VERSION%% + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ + && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ + | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 + +RUN apt-get update \ + && apt-get install -y postgresql-common \ + && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ + && apt-get install -y \ + postgresql-$PG_MAJOR=$PG_VERSION \ + postgresql-contrib-$PG_MAJOR=$PG_VERSION + +ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH +ENV PGDATA /var/lib/postgresql/data +VOLUME /var/lib/postgresql/data + +ADD ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/update.sh b/update.sh new file mode 100755 index 0000000000000..e3d0d790a734b --- /dev/null +++ b/update.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -e + +cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" + +versions=( "$@" ) +if [ ${#versions[@]} -eq 0 ]; then + versions=( */ ) +fi +versions=( "${versions[@]%/}" ) + +packagesUrl='http://apt.postgresql.org/pub/repos/apt/dists/wheezy-pgdg/main/binary-amd64/Packages' +packages="$(echo "$packagesUrl" | sed -r 's/[^a-zA-Z.-]+/-/g')" +curl -sSL "${packagesUrl}.bz2" | bunzip2 > "$packages" + +for version in "${versions[@]}"; do + fullVersion="$(grep -m1 -A10 "^Package: postgresql-$version\$" "$packages" | grep -m1 '^Version: ' | cut -d' ' -f2)" + ( + set -x + cp Dockerfile.template "$version/Dockerfile" + sed -i 's/%%PG_MAJOR%%/'$version'/g; s/%%PG_VERSION%%/'$fullVersion'/g' "$version/Dockerfile" + ) +done + +rm "$packages" From 783906f551b9bc1472751200296f93bb2c55bc44 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 1 Aug 2014 15:19:38 -0600 Subject: [PATCH 12/42] Whoops, refresh Dockerfiles from template --- 8.4/Dockerfile | 1 + 9.0/Dockerfile | 1 + 9.1/Dockerfile | 1 + 9.2/Dockerfile | 1 + 9.3/Dockerfile | 1 + 9.4/Dockerfile | 1 + 6 files changed, 6 insertions(+) diff --git a/8.4/Dockerfile b/8.4/Dockerfile index 9eb88d81de2f9..49c815761c1a8 100644 --- a/8.4/Dockerfile +++ b/8.4/Dockerfile @@ -1,3 +1,4 @@ +# vim:set ft=dockerfile: FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added diff --git a/9.0/Dockerfile b/9.0/Dockerfile index bf7e2fb50c53a..7a1040659c95c 100644 --- a/9.0/Dockerfile +++ b/9.0/Dockerfile @@ -1,3 +1,4 @@ +# vim:set ft=dockerfile: FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added diff --git a/9.1/Dockerfile b/9.1/Dockerfile index 9739a5686fc05..a7985b87f5aef 100644 --- a/9.1/Dockerfile +++ b/9.1/Dockerfile @@ -1,3 +1,4 @@ +# vim:set ft=dockerfile: FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added diff --git a/9.2/Dockerfile b/9.2/Dockerfile index 1ddb5f52727d6..aef56e5b3ff0c 100644 --- a/9.2/Dockerfile +++ b/9.2/Dockerfile @@ -1,3 +1,4 @@ +# vim:set ft=dockerfile: FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added diff --git a/9.3/Dockerfile b/9.3/Dockerfile index 90a6f347be870..827805b3232f0 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -1,3 +1,4 @@ +# vim:set ft=dockerfile: FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added diff --git a/9.4/Dockerfile b/9.4/Dockerfile index 04eb6b0f3d80e..4d8cb047d4a6f 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -1,3 +1,4 @@ +# vim:set ft=dockerfile: FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added From dc0a59178fc9e87ebfa3c0a2ba8c2634ce35bf7b Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Fri, 1 Aug 2014 15:19:47 -0600 Subject: [PATCH 13/42] Fix /var/run ownership --- 8.4/Dockerfile | 2 ++ 9.0/Dockerfile | 2 ++ 9.1/Dockerfile | 2 ++ 9.2/Dockerfile | 2 ++ 9.3/Dockerfile | 2 ++ 9.4/Dockerfile | 2 ++ Dockerfile.template | 2 ++ 7 files changed, 14 insertions(+) diff --git a/8.4/Dockerfile b/8.4/Dockerfile index 9eb88d81de2f9..d66ee513d4e52 100644 --- a/8.4/Dockerfile +++ b/8.4/Dockerfile @@ -22,6 +22,8 @@ RUN apt-get update \ postgresql-$PG_MAJOR=$PG_VERSION \ postgresql-contrib-$PG_MAJOR=$PG_VERSION +RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql + ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data diff --git a/9.0/Dockerfile b/9.0/Dockerfile index bf7e2fb50c53a..c2c58092b0c16 100644 --- a/9.0/Dockerfile +++ b/9.0/Dockerfile @@ -22,6 +22,8 @@ RUN apt-get update \ postgresql-$PG_MAJOR=$PG_VERSION \ postgresql-contrib-$PG_MAJOR=$PG_VERSION +RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql + ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data diff --git a/9.1/Dockerfile b/9.1/Dockerfile index 9739a5686fc05..98b6fb38abdb3 100644 --- a/9.1/Dockerfile +++ b/9.1/Dockerfile @@ -22,6 +22,8 @@ RUN apt-get update \ postgresql-$PG_MAJOR=$PG_VERSION \ postgresql-contrib-$PG_MAJOR=$PG_VERSION +RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql + ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data diff --git a/9.2/Dockerfile b/9.2/Dockerfile index 1ddb5f52727d6..f63740e7174c5 100644 --- a/9.2/Dockerfile +++ b/9.2/Dockerfile @@ -22,6 +22,8 @@ RUN apt-get update \ postgresql-$PG_MAJOR=$PG_VERSION \ postgresql-contrib-$PG_MAJOR=$PG_VERSION +RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql + ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data diff --git a/9.3/Dockerfile b/9.3/Dockerfile index 90a6f347be870..b6efd2c0742c4 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -22,6 +22,8 @@ RUN apt-get update \ postgresql-$PG_MAJOR=$PG_VERSION \ postgresql-contrib-$PG_MAJOR=$PG_VERSION +RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql + ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data diff --git a/9.4/Dockerfile b/9.4/Dockerfile index 04eb6b0f3d80e..9a61536bc13e8 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -22,6 +22,8 @@ RUN apt-get update \ postgresql-$PG_MAJOR=$PG_VERSION \ postgresql-contrib-$PG_MAJOR=$PG_VERSION +RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql + ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data diff --git a/Dockerfile.template b/Dockerfile.template index 02e8f02a2dea5..3da1d6e1af38c 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -23,6 +23,8 @@ RUN apt-get update \ postgresql-$PG_MAJOR=$PG_VERSION \ postgresql-contrib-$PG_MAJOR=$PG_VERSION +RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql + ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data From 8e917a6ba18d0b8c654c9f699472829fdcd554f9 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 1 Aug 2014 15:34:28 -0600 Subject: [PATCH 14/42] Add script to generate "library/postgres" for stackbrew --- generate-stackbrew-library.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 generate-stackbrew-library.sh diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh new file mode 100755 index 0000000000000..69ae4b721ae76 --- /dev/null +++ b/generate-stackbrew-library.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -e + +declare -A aliases +aliases=( + [9.3]='latest 9' + [8.4]='8' +) + +cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" + +versions=( */ ) +versions=( "${versions[@]%/}" ) +commit="$(git log -1 --format='format:%H')" +url='git://github.com/docker-library/postgres' + +echo '# maintainer: InfoSiftr (@infosiftr)' + +for version in "${versions[@]}"; do + fullVersion="$(grep -m1 'ENV PG_VERSION ' "$version/Dockerfile" | cut -d' ' -f3 | cut -d- -f1 | sed 's/~/-/g')" + versionAliases=( ${aliases[$version]} $version $fullVersion ) + + echo + for va in "${versionAliases[@]}"; do + echo "$va: ${url}@${commit} $version" + done +done From 4540606ea2645844623e9c429b6c7d1996327888 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 1 Aug 2014 15:48:37 -0600 Subject: [PATCH 15/42] Add more minor tweaks to generate-stackbrew-library.sh and update.sh --- docker-entrypoint.sh | 18 ++++++++++++++++++ generate-stackbrew-library.sh | 2 +- update.sh | 3 ++- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100755 docker-entrypoint.sh diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 0000000000000..5868bad075fef --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +if [ "$1" = 'postgres' ]; then + chown -R postgres "$PGDATA" + + if [ -z "$(ls -A "$PGDATA")" ]; then + gosu postgres initdb + + sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf + + { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + fi + + exec gosu postgres "$@" +fi + +exec "$@" diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 69ae4b721ae76..2592bff483e36 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -11,12 +11,12 @@ cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" versions=( */ ) versions=( "${versions[@]%/}" ) -commit="$(git log -1 --format='format:%H')" url='git://github.com/docker-library/postgres' echo '# maintainer: InfoSiftr (@infosiftr)' for version in "${versions[@]}"; do + commit="$(git log -1 --format='format:%H' "$version")" fullVersion="$(grep -m1 'ENV PG_VERSION ' "$version/Dockerfile" | cut -d' ' -f3 | cut -d- -f1 | sed 's/~/-/g')" versionAliases=( ${aliases[$version]} $version $fullVersion ) diff --git a/update.sh b/update.sh index e3d0d790a734b..649d716199856 100755 --- a/update.sh +++ b/update.sh @@ -17,7 +17,8 @@ for version in "${versions[@]}"; do fullVersion="$(grep -m1 -A10 "^Package: postgresql-$version\$" "$packages" | grep -m1 '^Version: ' | cut -d' ' -f2)" ( set -x - cp Dockerfile.template "$version/Dockerfile" + cp docker-entrypoint.sh Dockerfile.template "$version/" + mv "$version/Dockerfile.template" "$version/Dockerfile" sed -i 's/%%PG_MAJOR%%/'$version'/g; s/%%PG_VERSION%%/'$fullVersion'/g' "$version/Dockerfile" ) done From 65602d6ea8dcfc77a183d8576d15a93b4d4ce055 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 1 Aug 2014 15:54:05 -0600 Subject: [PATCH 16/42] Swap the order to be descending --- generate-stackbrew-library.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 2592bff483e36..230f74767bd70 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -3,7 +3,7 @@ set -e declare -A aliases aliases=( - [9.3]='latest 9' + [9.3]='9 latest' [8.4]='8' ) @@ -18,7 +18,7 @@ echo '# maintainer: InfoSiftr (@infosiftr)' for version in "${versions[@]}"; do commit="$(git log -1 --format='format:%H' "$version")" fullVersion="$(grep -m1 'ENV PG_VERSION ' "$version/Dockerfile" | cut -d' ' -f3 | cut -d- -f1 | sed 's/~/-/g')" - versionAliases=( ${aliases[$version]} $version $fullVersion ) + versionAliases=( $fullVersion $version ${aliases[$version]} ) echo for va in "${versionAliases[@]}"; do From d74b69598c835fe15eac39a26b5c61058f99c3db Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Fri, 15 Aug 2014 17:59:41 -0600 Subject: [PATCH 17/42] Add proper UTF-8 locale (thus enabling UTF-8 defaults) and update a few minor idioms that take the image from ~244.1 MB down to ~213.6 MB --- 8.4/Dockerfile | 21 ++++++++++++++------- 9.0/Dockerfile | 21 ++++++++++++++------- 9.1/Dockerfile | 21 ++++++++++++++------- 9.2/Dockerfile | 21 ++++++++++++++------- 9.3/Dockerfile | 21 ++++++++++++++------- 9.4/Dockerfile | 21 ++++++++++++++------- Dockerfile.template | 21 ++++++++++++++------- 7 files changed, 98 insertions(+), 49 deletions(-) diff --git a/8.4/Dockerfile b/8.4/Dockerfile index 2d419c24420dc..208562c72fc8c 100644 --- a/8.4/Dockerfile +++ b/8.4/Dockerfile @@ -4,24 +4,31 @@ FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r postgres && useradd -r -g postgres postgres -RUN apt-get update && apt-get install -y curl +# grab gosu for easy step-down from root +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ + && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && chmod +x /usr/local/bin/gosu \ + && apt-get purge -y --auto-remove curl -RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ - && chmod +x /usr/local/bin/gosu +# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default +RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \ + && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 +ENV LANG en_US.utf8 + +RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 8.4 ENV PG_VERSION 8.4.22-1.pgdg70+1 -RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ - && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ - | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ && apt-get install -y \ postgresql-$PG_MAJOR=$PG_VERSION \ - postgresql-contrib-$PG_MAJOR=$PG_VERSION + postgresql-contrib-$PG_MAJOR=$PG_VERSION \ + && rm -rf /var/lib/apt/lists/* RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql diff --git a/9.0/Dockerfile b/9.0/Dockerfile index b4efa301078f8..9658c1145f76e 100644 --- a/9.0/Dockerfile +++ b/9.0/Dockerfile @@ -4,24 +4,31 @@ FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r postgres && useradd -r -g postgres postgres -RUN apt-get update && apt-get install -y curl +# grab gosu for easy step-down from root +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ + && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && chmod +x /usr/local/bin/gosu \ + && apt-get purge -y --auto-remove curl -RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ - && chmod +x /usr/local/bin/gosu +# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default +RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \ + && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 +ENV LANG en_US.utf8 + +RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.0 ENV PG_VERSION 9.0.18-1.pgdg70+1 -RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ - && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ - | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ && apt-get install -y \ postgresql-$PG_MAJOR=$PG_VERSION \ - postgresql-contrib-$PG_MAJOR=$PG_VERSION + postgresql-contrib-$PG_MAJOR=$PG_VERSION \ + && rm -rf /var/lib/apt/lists/* RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql diff --git a/9.1/Dockerfile b/9.1/Dockerfile index d58f8be5f8555..de4dba7736b8c 100644 --- a/9.1/Dockerfile +++ b/9.1/Dockerfile @@ -4,24 +4,31 @@ FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r postgres && useradd -r -g postgres postgres -RUN apt-get update && apt-get install -y curl +# grab gosu for easy step-down from root +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ + && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && chmod +x /usr/local/bin/gosu \ + && apt-get purge -y --auto-remove curl -RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ - && chmod +x /usr/local/bin/gosu +# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default +RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \ + && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 +ENV LANG en_US.utf8 + +RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.1 ENV PG_VERSION 9.1.14-1.pgdg70+1 -RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ - && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ - | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ && apt-get install -y \ postgresql-$PG_MAJOR=$PG_VERSION \ - postgresql-contrib-$PG_MAJOR=$PG_VERSION + postgresql-contrib-$PG_MAJOR=$PG_VERSION \ + && rm -rf /var/lib/apt/lists/* RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql diff --git a/9.2/Dockerfile b/9.2/Dockerfile index 6a91f8378852a..abbe75602d432 100644 --- a/9.2/Dockerfile +++ b/9.2/Dockerfile @@ -4,24 +4,31 @@ FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r postgres && useradd -r -g postgres postgres -RUN apt-get update && apt-get install -y curl +# grab gosu for easy step-down from root +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ + && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && chmod +x /usr/local/bin/gosu \ + && apt-get purge -y --auto-remove curl -RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ - && chmod +x /usr/local/bin/gosu +# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default +RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \ + && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 +ENV LANG en_US.utf8 + +RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.2 ENV PG_VERSION 9.2.9-1.pgdg70+1 -RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ - && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ - | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ && apt-get install -y \ postgresql-$PG_MAJOR=$PG_VERSION \ - postgresql-contrib-$PG_MAJOR=$PG_VERSION + postgresql-contrib-$PG_MAJOR=$PG_VERSION \ + && rm -rf /var/lib/apt/lists/* RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql diff --git a/9.3/Dockerfile b/9.3/Dockerfile index 4f52e969e4d1b..a9ff116e03241 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -4,24 +4,31 @@ FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r postgres && useradd -r -g postgres postgres -RUN apt-get update && apt-get install -y curl +# grab gosu for easy step-down from root +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ + && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && chmod +x /usr/local/bin/gosu \ + && apt-get purge -y --auto-remove curl -RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ - && chmod +x /usr/local/bin/gosu +# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default +RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \ + && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 +ENV LANG en_US.utf8 + +RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.3 ENV PG_VERSION 9.3.5-1.pgdg70+1 -RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ - && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ - | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ && apt-get install -y \ postgresql-$PG_MAJOR=$PG_VERSION \ - postgresql-contrib-$PG_MAJOR=$PG_VERSION + postgresql-contrib-$PG_MAJOR=$PG_VERSION \ + && rm -rf /var/lib/apt/lists/* RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql diff --git a/9.4/Dockerfile b/9.4/Dockerfile index 152229e6719e5..a82357a142435 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -4,24 +4,31 @@ FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r postgres && useradd -r -g postgres postgres -RUN apt-get update && apt-get install -y curl +# grab gosu for easy step-down from root +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ + && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && chmod +x /usr/local/bin/gosu \ + && apt-get purge -y --auto-remove curl -RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ - && chmod +x /usr/local/bin/gosu +# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default +RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \ + && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 +ENV LANG en_US.utf8 + +RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.4 ENV PG_VERSION 9.4~beta2-1.pgdg70+1 -RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ - && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ - | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ && apt-get install -y \ postgresql-$PG_MAJOR=$PG_VERSION \ - postgresql-contrib-$PG_MAJOR=$PG_VERSION + postgresql-contrib-$PG_MAJOR=$PG_VERSION \ + && rm -rf /var/lib/apt/lists/* RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql diff --git a/Dockerfile.template b/Dockerfile.template index 3da1d6e1af38c..0cd09ee548cb9 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -4,24 +4,31 @@ FROM debian:wheezy # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r postgres && useradd -r -g postgres postgres -RUN apt-get update && apt-get install -y curl +# grab gosu for easy step-down from root +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ + && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && chmod +x /usr/local/bin/gosu \ + && apt-get purge -y --auto-remove curl -RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ - && chmod +x /usr/local/bin/gosu +# make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default +RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \ + && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 +ENV LANG en_US.utf8 + +RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR %%PG_MAJOR%% ENV PG_VERSION %%PG_VERSION%% -RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list \ - && curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \ - | apt-key add - ED6D65271AACF0FF15D123036FB2A1C265FFB764 +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list RUN apt-get update \ && apt-get install -y postgresql-common \ && sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf \ && apt-get install -y \ postgresql-$PG_MAJOR=$PG_VERSION \ - postgresql-contrib-$PG_MAJOR=$PG_VERSION + postgresql-contrib-$PG_MAJOR=$PG_VERSION \ + && rm -rf /var/lib/apt/lists/* RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql From 12b0f31cfe419ebe5e3de91e64114ecd57272753 Mon Sep 17 00:00:00 2001 From: sprin Date: Wed, 3 Sep 2014 10:00:52 -0700 Subject: [PATCH 18/42] LICENSE (the MIT License) and AUTHORS --- AUTHORS | 6 ++++++ LICENSE | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 AUTHORS create mode 100644 LICENSE diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000000000..d3ad2447a2d7f --- /dev/null +++ b/AUTHORS @@ -0,0 +1,6 @@ +Docker PostgreSQL Authors + +Tianon Gravi +Joseph Ferguson + +And other contributors not specifically named here. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000..f86b1322e63ac --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2014, Docker PostgreSQL Authors (See AUTHORS) + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. From 33b8046b5f68b465a3c04fcc428e8923bcb7cd12 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 9 Sep 2014 11:01:28 -0600 Subject: [PATCH 19/42] Replace `ADD` with `COPY` --- 8.4/Dockerfile | 2 +- 9.0/Dockerfile | 2 +- 9.1/Dockerfile | 2 +- 9.2/Dockerfile | 2 +- 9.3/Dockerfile | 2 +- 9.4/Dockerfile | 2 +- Dockerfile.template | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/8.4/Dockerfile b/8.4/Dockerfile index 208562c72fc8c..d3be0ad93452c 100644 --- a/8.4/Dockerfile +++ b/8.4/Dockerfile @@ -36,7 +36,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -ADD ./docker-entrypoint.sh / +COPY ./docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/9.0/Dockerfile b/9.0/Dockerfile index 9658c1145f76e..9274944985fd8 100644 --- a/9.0/Dockerfile +++ b/9.0/Dockerfile @@ -36,7 +36,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -ADD ./docker-entrypoint.sh / +COPY ./docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/9.1/Dockerfile b/9.1/Dockerfile index de4dba7736b8c..b58fbdd6e7f64 100644 --- a/9.1/Dockerfile +++ b/9.1/Dockerfile @@ -36,7 +36,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -ADD ./docker-entrypoint.sh / +COPY ./docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/9.2/Dockerfile b/9.2/Dockerfile index abbe75602d432..91bd7a326c9ec 100644 --- a/9.2/Dockerfile +++ b/9.2/Dockerfile @@ -36,7 +36,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -ADD ./docker-entrypoint.sh / +COPY ./docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/9.3/Dockerfile b/9.3/Dockerfile index a9ff116e03241..487e748bd5fd7 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -36,7 +36,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -ADD ./docker-entrypoint.sh / +COPY ./docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/9.4/Dockerfile b/9.4/Dockerfile index a82357a142435..e6942a2fed7e0 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -36,7 +36,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -ADD ./docker-entrypoint.sh / +COPY ./docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfile.template b/Dockerfile.template index 0cd09ee548cb9..9d86078a9f46e 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -36,7 +36,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -ADD ./docker-entrypoint.sh / +COPY ./docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] From 94aee2022d2014230fad3d054c048678137281d1 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Sat, 13 Sep 2014 17:54:07 -0600 Subject: [PATCH 20/42] Update 9.4 to 9.4~beta2-2~129.bzr487.pgdg70+1 --- 9.4/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/9.4/Dockerfile b/9.4/Dockerfile index e6942a2fed7e0..0b22b529d42eb 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -18,7 +18,7 @@ ENV LANG en_US.utf8 RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.4 -ENV PG_VERSION 9.4~beta2-1.pgdg70+1 +ENV PG_VERSION 9.4~beta2-2~129.bzr487.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list From 4603177ae330d135dea953b42aec28fe1eef514e Mon Sep 17 00:00:00 2001 From: Mike Dillon Date: Wed, 8 Oct 2014 20:55:25 -0700 Subject: [PATCH 21/42] Add support for /docker-entrypoint-initdb.d/ --- 8.4/docker-entrypoint.sh | 6 ++++++ 9.0/docker-entrypoint.sh | 6 ++++++ 9.1/docker-entrypoint.sh | 6 ++++++ 9.2/docker-entrypoint.sh | 6 ++++++ 9.3/docker-entrypoint.sh | 6 ++++++ 9.4/docker-entrypoint.sh | 6 ++++++ docker-entrypoint.sh | 6 ++++++ 7 files changed, 42 insertions(+) diff --git a/8.4/docker-entrypoint.sh b/8.4/docker-entrypoint.sh index 5868bad075fef..8011908aca843 100755 --- a/8.4/docker-entrypoint.sh +++ b/8.4/docker-entrypoint.sh @@ -10,6 +10,12 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + + if [ -d /docker-entrypoint-initdb.d ]; then + for f in /docker-entrypoint-initdb.d/*.sh; do + [ -f "$f" ] && . "$f" + done + fi fi exec gosu postgres "$@" diff --git a/9.0/docker-entrypoint.sh b/9.0/docker-entrypoint.sh index 5868bad075fef..8011908aca843 100755 --- a/9.0/docker-entrypoint.sh +++ b/9.0/docker-entrypoint.sh @@ -10,6 +10,12 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + + if [ -d /docker-entrypoint-initdb.d ]; then + for f in /docker-entrypoint-initdb.d/*.sh; do + [ -f "$f" ] && . "$f" + done + fi fi exec gosu postgres "$@" diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index 5868bad075fef..8011908aca843 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -10,6 +10,12 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + + if [ -d /docker-entrypoint-initdb.d ]; then + for f in /docker-entrypoint-initdb.d/*.sh; do + [ -f "$f" ] && . "$f" + done + fi fi exec gosu postgres "$@" diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index 5868bad075fef..8011908aca843 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -10,6 +10,12 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + + if [ -d /docker-entrypoint-initdb.d ]; then + for f in /docker-entrypoint-initdb.d/*.sh; do + [ -f "$f" ] && . "$f" + done + fi fi exec gosu postgres "$@" diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index 5868bad075fef..8011908aca843 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -10,6 +10,12 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + + if [ -d /docker-entrypoint-initdb.d ]; then + for f in /docker-entrypoint-initdb.d/*.sh; do + [ -f "$f" ] && . "$f" + done + fi fi exec gosu postgres "$@" diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index 5868bad075fef..8011908aca843 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -10,6 +10,12 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + + if [ -d /docker-entrypoint-initdb.d ]; then + for f in /docker-entrypoint-initdb.d/*.sh; do + [ -f "$f" ] && . "$f" + done + fi fi exec gosu postgres "$@" diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 5868bad075fef..8011908aca843 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -10,6 +10,12 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf + + if [ -d /docker-entrypoint-initdb.d ]; then + for f in /docker-entrypoint-initdb.d/*.sh; do + [ -f "$f" ] && . "$f" + done + fi fi exec gosu postgres "$@" From 69a30d9e6f12c57296b11d3511127210466f0197 Mon Sep 17 00:00:00 2001 From: Chia-liang Kao Date: Sun, 12 Oct 2014 14:40:33 +0800 Subject: [PATCH 22/42] Update 9.4 to beta3 --- 9.4/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/9.4/Dockerfile b/9.4/Dockerfile index 0b22b529d42eb..fcf9b90bc82ac 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -18,7 +18,7 @@ ENV LANG en_US.utf8 RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.4 -ENV PG_VERSION 9.4~beta2-2~129.bzr487.pgdg70+1 +ENV PG_VERSION 9.4~beta3-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list From 3d64d17ac2cc606202b9c99465de1508a57a85f3 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Fri, 14 Nov 2014 16:17:38 -0800 Subject: [PATCH 23/42] Add readme stub --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000000000..fed80e21618d1 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# About this Repo + +This is the Git repo of the official Docker image for [postgres](https://registry.hub.docker.com/_/postgres/). See the +Hub page for the full readme on how to use the Docker image and for information +regarding contributing and issues. + +The full readme is generated over in [docker-library/docs](https://github.com/docker-library/docs), +specificially in [docker-library/docs/postgres](https://github.com/docker-library/docs/tree/master/postgres). From 80ebeda0a68be6a8b10ce0de1846a49228af0795 Mon Sep 17 00:00:00 2001 From: Mateusz Marzantowicz Date: Tue, 18 Nov 2014 23:25:15 +0100 Subject: [PATCH 24/42] Explicitly create /docker-entrypoint-initdb.d directory --- 8.4/Dockerfile | 2 ++ 9.0/Dockerfile | 2 ++ 9.1/Dockerfile | 2 ++ 9.2/Dockerfile | 2 ++ 9.3/Dockerfile | 2 ++ 9.4/Dockerfile | 2 ++ Dockerfile.template | 2 ++ 7 files changed, 14 insertions(+) diff --git a/8.4/Dockerfile b/8.4/Dockerfile index d3be0ad93452c..78463390f012b 100644 --- a/8.4/Dockerfile +++ b/8.4/Dockerfile @@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 +RUN mkdir /docker-entrypoint-initdb.d + RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 8.4 diff --git a/9.0/Dockerfile b/9.0/Dockerfile index 9274944985fd8..c901d4104869e 100644 --- a/9.0/Dockerfile +++ b/9.0/Dockerfile @@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 +RUN mkdir /docker-entrypoint-initdb.d + RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.0 diff --git a/9.1/Dockerfile b/9.1/Dockerfile index b58fbdd6e7f64..683f8ba2b2f6e 100644 --- a/9.1/Dockerfile +++ b/9.1/Dockerfile @@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 +RUN mkdir /docker-entrypoint-initdb.d + RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.1 diff --git a/9.2/Dockerfile b/9.2/Dockerfile index 91bd7a326c9ec..b321cbf65113b 100644 --- a/9.2/Dockerfile +++ b/9.2/Dockerfile @@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 +RUN mkdir /docker-entrypoint-initdb.d + RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.2 diff --git a/9.3/Dockerfile b/9.3/Dockerfile index 487e748bd5fd7..df835918afbb1 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 +RUN mkdir /docker-entrypoint-initdb.d + RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.3 diff --git a/9.4/Dockerfile b/9.4/Dockerfile index fcf9b90bc82ac..346877656fe4e 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 +RUN mkdir /docker-entrypoint-initdb.d + RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.4 diff --git a/Dockerfile.template b/Dockerfile.template index 9d86078a9f46e..b4511a89d8ca0 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -15,6 +15,8 @@ RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8 ENV LANG en_US.utf8 +RUN mkdir /docker-entrypoint-initdb.d + RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR %%PG_MAJOR%% From 73d73760957c7038dd3c07212b5b9daf86a2cb38 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 19 Nov 2014 01:18:45 -0700 Subject: [PATCH 25/42] Update to gosu 1.2 (including GPG verification) --- 8.4/Dockerfile | 6 +++++- 9.0/Dockerfile | 6 +++++- 9.1/Dockerfile | 6 +++++- 9.2/Dockerfile | 6 +++++- 9.3/Dockerfile | 6 +++++- 9.4/Dockerfile | 6 +++++- Dockerfile.template | 6 +++++- 7 files changed, 35 insertions(+), 7 deletions(-) diff --git a/8.4/Dockerfile b/8.4/Dockerfile index d3be0ad93452c..551eea63da086 100644 --- a/8.4/Dockerfile +++ b/8.4/Dockerfile @@ -5,8 +5,12 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root +RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ + && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ + && gpg --verify /usr/local/bin/gosu.asc \ + && rm /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/9.0/Dockerfile b/9.0/Dockerfile index 9274944985fd8..ccd80c5822ba2 100644 --- a/9.0/Dockerfile +++ b/9.0/Dockerfile @@ -5,8 +5,12 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root +RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ + && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ + && gpg --verify /usr/local/bin/gosu.asc \ + && rm /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/9.1/Dockerfile b/9.1/Dockerfile index b58fbdd6e7f64..8808c2a645acf 100644 --- a/9.1/Dockerfile +++ b/9.1/Dockerfile @@ -5,8 +5,12 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root +RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ + && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ + && gpg --verify /usr/local/bin/gosu.asc \ + && rm /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/9.2/Dockerfile b/9.2/Dockerfile index 91bd7a326c9ec..4c2e22f15bc60 100644 --- a/9.2/Dockerfile +++ b/9.2/Dockerfile @@ -5,8 +5,12 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root +RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ + && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ + && gpg --verify /usr/local/bin/gosu.asc \ + && rm /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/9.3/Dockerfile b/9.3/Dockerfile index 487e748bd5fd7..560d556d72e97 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -5,8 +5,12 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root +RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ + && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ + && gpg --verify /usr/local/bin/gosu.asc \ + && rm /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/9.4/Dockerfile b/9.4/Dockerfile index fcf9b90bc82ac..9b21b3ffd6a77 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -5,8 +5,12 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root +RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ + && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ + && gpg --verify /usr/local/bin/gosu.asc \ + && rm /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl diff --git a/Dockerfile.template b/Dockerfile.template index 9d86078a9f46e..49f9fad51e2d5 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -5,8 +5,12 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root +RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ - && curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \ + && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ + && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ + && gpg --verify /usr/local/bin/gosu.asc \ + && rm /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu \ && apt-get purge -y --auto-remove curl From e30347e48b1f1528fccf4d26efea5834ae9b2869 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Wed, 19 Nov 2014 15:55:50 -0800 Subject: [PATCH 26/42] Add POSTGRES_PASSWORD and USER, with warning on no password --- 8.4/docker-entrypoint.sh | 36 ++++++++++++++++++++++++++++++++++-- 9.0/docker-entrypoint.sh | 36 ++++++++++++++++++++++++++++++++++-- 9.1/docker-entrypoint.sh | 36 ++++++++++++++++++++++++++++++++++-- 9.2/docker-entrypoint.sh | 36 ++++++++++++++++++++++++++++++++++-- 9.3/docker-entrypoint.sh | 36 ++++++++++++++++++++++++++++++++++-- 9.4/docker-entrypoint.sh | 36 ++++++++++++++++++++++++++++++++++-- docker-entrypoint.sh | 36 ++++++++++++++++++++++++++++++++++-- 7 files changed, 238 insertions(+), 14 deletions(-) diff --git a/8.4/docker-entrypoint.sh b/8.4/docker-entrypoint.sh index 8011908aca843..e07a76e997525 100755 --- a/8.4/docker-entrypoint.sh +++ b/8.4/docker-entrypoint.sh @@ -9,8 +9,40 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf - { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf - + # check password first so we can ouptut the warning before postgres + # messes it up + if [ "$POSTGRES_PASSWORD" ]; then + pass="PASSWORD '$POSTGRES_PASSWORD'" + authMethod=md5 + else + # The - option suppresses leading tabs but *not* spaces. :) + cat >&2 <<-'EOWARN' + **************************************************** + WARNING: No password has been set for the database. + Use "-e POSTGRES_PASSWORD=password" to set + it in "docker run". + **************************************************** + EOWARN + + pass= + authMethod=trust + fi + + : ${POSTGRES_USER:=postgres} + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + gosu postgres postgres --single -E <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" + EOSQL + fi + + gosu postgres postgres --single <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + EOSQL + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do [ -f "$f" ] && . "$f" diff --git a/9.0/docker-entrypoint.sh b/9.0/docker-entrypoint.sh index 8011908aca843..e07a76e997525 100755 --- a/9.0/docker-entrypoint.sh +++ b/9.0/docker-entrypoint.sh @@ -9,8 +9,40 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf - { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf - + # check password first so we can ouptut the warning before postgres + # messes it up + if [ "$POSTGRES_PASSWORD" ]; then + pass="PASSWORD '$POSTGRES_PASSWORD'" + authMethod=md5 + else + # The - option suppresses leading tabs but *not* spaces. :) + cat >&2 <<-'EOWARN' + **************************************************** + WARNING: No password has been set for the database. + Use "-e POSTGRES_PASSWORD=password" to set + it in "docker run". + **************************************************** + EOWARN + + pass= + authMethod=trust + fi + + : ${POSTGRES_USER:=postgres} + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + gosu postgres postgres --single -E <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" + EOSQL + fi + + gosu postgres postgres --single <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + EOSQL + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do [ -f "$f" ] && . "$f" diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index 8011908aca843..e07a76e997525 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -9,8 +9,40 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf - { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf - + # check password first so we can ouptut the warning before postgres + # messes it up + if [ "$POSTGRES_PASSWORD" ]; then + pass="PASSWORD '$POSTGRES_PASSWORD'" + authMethod=md5 + else + # The - option suppresses leading tabs but *not* spaces. :) + cat >&2 <<-'EOWARN' + **************************************************** + WARNING: No password has been set for the database. + Use "-e POSTGRES_PASSWORD=password" to set + it in "docker run". + **************************************************** + EOWARN + + pass= + authMethod=trust + fi + + : ${POSTGRES_USER:=postgres} + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + gosu postgres postgres --single -E <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" + EOSQL + fi + + gosu postgres postgres --single <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + EOSQL + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do [ -f "$f" ] && . "$f" diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index 8011908aca843..e07a76e997525 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -9,8 +9,40 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf - { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf - + # check password first so we can ouptut the warning before postgres + # messes it up + if [ "$POSTGRES_PASSWORD" ]; then + pass="PASSWORD '$POSTGRES_PASSWORD'" + authMethod=md5 + else + # The - option suppresses leading tabs but *not* spaces. :) + cat >&2 <<-'EOWARN' + **************************************************** + WARNING: No password has been set for the database. + Use "-e POSTGRES_PASSWORD=password" to set + it in "docker run". + **************************************************** + EOWARN + + pass= + authMethod=trust + fi + + : ${POSTGRES_USER:=postgres} + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + gosu postgres postgres --single -E <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" + EOSQL + fi + + gosu postgres postgres --single <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + EOSQL + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do [ -f "$f" ] && . "$f" diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index 8011908aca843..e07a76e997525 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -9,8 +9,40 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf - { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf - + # check password first so we can ouptut the warning before postgres + # messes it up + if [ "$POSTGRES_PASSWORD" ]; then + pass="PASSWORD '$POSTGRES_PASSWORD'" + authMethod=md5 + else + # The - option suppresses leading tabs but *not* spaces. :) + cat >&2 <<-'EOWARN' + **************************************************** + WARNING: No password has been set for the database. + Use "-e POSTGRES_PASSWORD=password" to set + it in "docker run". + **************************************************** + EOWARN + + pass= + authMethod=trust + fi + + : ${POSTGRES_USER:=postgres} + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + gosu postgres postgres --single -E <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" + EOSQL + fi + + gosu postgres postgres --single <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + EOSQL + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do [ -f "$f" ] && . "$f" diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index 8011908aca843..e07a76e997525 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -9,8 +9,40 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf - { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf - + # check password first so we can ouptut the warning before postgres + # messes it up + if [ "$POSTGRES_PASSWORD" ]; then + pass="PASSWORD '$POSTGRES_PASSWORD'" + authMethod=md5 + else + # The - option suppresses leading tabs but *not* spaces. :) + cat >&2 <<-'EOWARN' + **************************************************** + WARNING: No password has been set for the database. + Use "-e POSTGRES_PASSWORD=password" to set + it in "docker run". + **************************************************** + EOWARN + + pass= + authMethod=trust + fi + + : ${POSTGRES_USER:=postgres} + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + gosu postgres postgres --single -E <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" + EOSQL + fi + + gosu postgres postgres --single <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + EOSQL + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do [ -f "$f" ] && . "$f" diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 8011908aca843..e07a76e997525 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -9,8 +9,40 @@ if [ "$1" = 'postgres' ]; then sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf - { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf - + # check password first so we can ouptut the warning before postgres + # messes it up + if [ "$POSTGRES_PASSWORD" ]; then + pass="PASSWORD '$POSTGRES_PASSWORD'" + authMethod=md5 + else + # The - option suppresses leading tabs but *not* spaces. :) + cat >&2 <<-'EOWARN' + **************************************************** + WARNING: No password has been set for the database. + Use "-e POSTGRES_PASSWORD=password" to set + it in "docker run". + **************************************************** + EOWARN + + pass= + authMethod=trust + fi + + : ${POSTGRES_USER:=postgres} + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + gosu postgres postgres --single -E <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" + EOSQL + fi + + gosu postgres postgres --single <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + EOSQL + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do [ -f "$f" ] && . "$f" From 595fb3798892feb36bc81f01317861ddcdc6521b Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Thu, 20 Nov 2014 10:17:17 -0800 Subject: [PATCH 27/42] Bump 9.4 to rc1 --- 9.4/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/9.4/Dockerfile b/9.4/Dockerfile index 9e6dca61370eb..872a4ed396324 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -24,7 +24,7 @@ RUN mkdir /docker-entrypoint-initdb.d RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.4 -ENV PG_VERSION 9.4~beta3-1.pgdg70+1 +ENV PG_VERSION 9.4~rc1-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list From fc445dc0b539293df9cf54bee9824ce1e3bb5e72 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 25 Nov 2014 22:04:02 -0700 Subject: [PATCH 28/42] Fix minor "git log" usage issue --- generate-stackbrew-library.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 230f74767bd70..4cf82ba90f78e 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -16,7 +16,7 @@ url='git://github.com/docker-library/postgres' echo '# maintainer: InfoSiftr (@infosiftr)' for version in "${versions[@]}"; do - commit="$(git log -1 --format='format:%H' "$version")" + commit="$(git log -1 --format='format:%H' -- "$version")" fullVersion="$(grep -m1 'ENV PG_VERSION ' "$version/Dockerfile" | cut -d' ' -f3 | cut -d- -f1 | sed 's/~/-/g')" versionAliases=( $fullVersion $version ${aliases[$version]} ) From 5f401753715311752f2346cdbd32bd55e7251ddd Mon Sep 17 00:00:00 2001 From: Matt Wright Date: Thu, 18 Dec 2014 13:21:17 -0500 Subject: [PATCH 29/42] Update Dockerfile Update to official [9.4.0 release](http://www.postgresql.org/about/news/1557/) --- 9.4/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/9.4/Dockerfile b/9.4/Dockerfile index 872a4ed396324..af27f9d468099 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -24,7 +24,7 @@ RUN mkdir /docker-entrypoint-initdb.d RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.4 -ENV PG_VERSION 9.4~rc1-1.pgdg70+1 +ENV PG_VERSION 9.4.0-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list From bfa7152926890a27e9fd8925fdffa824c353480a Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Thu, 18 Dec 2014 12:59:26 -0800 Subject: [PATCH 30/42] Bump 9.3, move latest to 9.4 --- 9.3/Dockerfile | 2 +- generate-stackbrew-library.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/9.3/Dockerfile b/9.3/Dockerfile index 56a93cff85a03..5dad65fcbccfd 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -24,7 +24,7 @@ RUN mkdir /docker-entrypoint-initdb.d RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.3 -ENV PG_VERSION 9.3.5-1.pgdg70+1 +ENV PG_VERSION 9.3.5-2.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list diff --git a/generate-stackbrew-library.sh b/generate-stackbrew-library.sh index 4cf82ba90f78e..00385bab6cfcd 100755 --- a/generate-stackbrew-library.sh +++ b/generate-stackbrew-library.sh @@ -3,7 +3,7 @@ set -e declare -A aliases aliases=( - [9.3]='9 latest' + [9.4]='9 latest' [8.4]='8' ) From c9d9f4c1a0d33a161fefda666f041ef0dc4dc9f8 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Wed, 24 Dec 2014 16:43:17 -0700 Subject: [PATCH 31/42] Minor formatting/output changes --- 8.4/Dockerfile | 2 +- 8.4/docker-entrypoint.sh | 13 ++++++++----- 9.0/Dockerfile | 2 +- 9.0/docker-entrypoint.sh | 13 ++++++++----- 9.1/Dockerfile | 2 +- 9.1/docker-entrypoint.sh | 13 ++++++++----- 9.2/Dockerfile | 2 +- 9.2/docker-entrypoint.sh | 13 ++++++++----- 9.3/Dockerfile | 2 +- 9.3/docker-entrypoint.sh | 13 ++++++++----- 9.4/Dockerfile | 2 +- 9.4/docker-entrypoint.sh | 13 ++++++++----- Dockerfile.template | 2 +- docker-entrypoint.sh | 13 ++++++++----- 14 files changed, 63 insertions(+), 42 deletions(-) diff --git a/8.4/Dockerfile b/8.4/Dockerfile index 962124ccc715d..1ba0a448d6d70 100644 --- a/8.4/Dockerfile +++ b/8.4/Dockerfile @@ -42,7 +42,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +COPY docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/8.4/docker-entrypoint.sh b/8.4/docker-entrypoint.sh index e07a76e997525..28f8354f7054d 100755 --- a/8.4/docker-entrypoint.sh +++ b/8.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then pass="PASSWORD '$POSTGRES_PASSWORD'" authMethod=md5 else - # The - option suppresses leading tabs but *not* spaces. :) + # The - option suppresses leading tabs but *not* spaces. :) cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. @@ -33,14 +33,17 @@ if [ "$1" = 'postgres' ]; then op='ALTER' else op='CREATE' - gosu postgres postgres --single -E <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" + gosu postgres postgres --single -jE <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" ; EOSQL + echo fi - gosu postgres postgres --single <<-EOSQL - $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + gosu postgres postgres --single -jE <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL + echo + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then diff --git a/9.0/Dockerfile b/9.0/Dockerfile index b4b875d17febe..6ddcbd60c0cba 100644 --- a/9.0/Dockerfile +++ b/9.0/Dockerfile @@ -42,7 +42,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +COPY docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/9.0/docker-entrypoint.sh b/9.0/docker-entrypoint.sh index e07a76e997525..28f8354f7054d 100755 --- a/9.0/docker-entrypoint.sh +++ b/9.0/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then pass="PASSWORD '$POSTGRES_PASSWORD'" authMethod=md5 else - # The - option suppresses leading tabs but *not* spaces. :) + # The - option suppresses leading tabs but *not* spaces. :) cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. @@ -33,14 +33,17 @@ if [ "$1" = 'postgres' ]; then op='ALTER' else op='CREATE' - gosu postgres postgres --single -E <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" + gosu postgres postgres --single -jE <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" ; EOSQL + echo fi - gosu postgres postgres --single <<-EOSQL - $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + gosu postgres postgres --single -jE <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL + echo + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then diff --git a/9.1/Dockerfile b/9.1/Dockerfile index cee7632bf5e3f..7b78548b9b49c 100644 --- a/9.1/Dockerfile +++ b/9.1/Dockerfile @@ -42,7 +42,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +COPY docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index e07a76e997525..28f8354f7054d 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then pass="PASSWORD '$POSTGRES_PASSWORD'" authMethod=md5 else - # The - option suppresses leading tabs but *not* spaces. :) + # The - option suppresses leading tabs but *not* spaces. :) cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. @@ -33,14 +33,17 @@ if [ "$1" = 'postgres' ]; then op='ALTER' else op='CREATE' - gosu postgres postgres --single -E <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" + gosu postgres postgres --single -jE <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" ; EOSQL + echo fi - gosu postgres postgres --single <<-EOSQL - $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + gosu postgres postgres --single -jE <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL + echo + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then diff --git a/9.2/Dockerfile b/9.2/Dockerfile index bb1fbcd4267bc..9c5d46808ca5c 100644 --- a/9.2/Dockerfile +++ b/9.2/Dockerfile @@ -42,7 +42,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +COPY docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index e07a76e997525..28f8354f7054d 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then pass="PASSWORD '$POSTGRES_PASSWORD'" authMethod=md5 else - # The - option suppresses leading tabs but *not* spaces. :) + # The - option suppresses leading tabs but *not* spaces. :) cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. @@ -33,14 +33,17 @@ if [ "$1" = 'postgres' ]; then op='ALTER' else op='CREATE' - gosu postgres postgres --single -E <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" + gosu postgres postgres --single -jE <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" ; EOSQL + echo fi - gosu postgres postgres --single <<-EOSQL - $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + gosu postgres postgres --single -jE <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL + echo + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then diff --git a/9.3/Dockerfile b/9.3/Dockerfile index 5dad65fcbccfd..c0dae9e96c932 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -42,7 +42,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +COPY docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index e07a76e997525..28f8354f7054d 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then pass="PASSWORD '$POSTGRES_PASSWORD'" authMethod=md5 else - # The - option suppresses leading tabs but *not* spaces. :) + # The - option suppresses leading tabs but *not* spaces. :) cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. @@ -33,14 +33,17 @@ if [ "$1" = 'postgres' ]; then op='ALTER' else op='CREATE' - gosu postgres postgres --single -E <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" + gosu postgres postgres --single -jE <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" ; EOSQL + echo fi - gosu postgres postgres --single <<-EOSQL - $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + gosu postgres postgres --single -jE <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL + echo + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then diff --git a/9.4/Dockerfile b/9.4/Dockerfile index af27f9d468099..92e2752379278 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -42,7 +42,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +COPY docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index e07a76e997525..28f8354f7054d 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then pass="PASSWORD '$POSTGRES_PASSWORD'" authMethod=md5 else - # The - option suppresses leading tabs but *not* spaces. :) + # The - option suppresses leading tabs but *not* spaces. :) cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. @@ -33,14 +33,17 @@ if [ "$1" = 'postgres' ]; then op='ALTER' else op='CREATE' - gosu postgres postgres --single -E <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" + gosu postgres postgres --single -jE <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" ; EOSQL + echo fi - gosu postgres postgres --single <<-EOSQL - $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + gosu postgres postgres --single -jE <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL + echo + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then diff --git a/Dockerfile.template b/Dockerfile.template index c01b0856df33e..0ff7b6f269f67 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -42,7 +42,7 @@ ENV PATH /usr/lib/postgresql/$PG_MAJOR/bin:$PATH ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +COPY docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index e07a76e997525..28f8354f7054d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -15,7 +15,7 @@ if [ "$1" = 'postgres' ]; then pass="PASSWORD '$POSTGRES_PASSWORD'" authMethod=md5 else - # The - option suppresses leading tabs but *not* spaces. :) + # The - option suppresses leading tabs but *not* spaces. :) cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. @@ -33,14 +33,17 @@ if [ "$1" = 'postgres' ]; then op='ALTER' else op='CREATE' - gosu postgres postgres --single -E <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" + gosu postgres postgres --single -jE <<-EOSQL + CREATE DATABASE "$POSTGRES_USER" ; EOSQL + echo fi - gosu postgres postgres --single <<-EOSQL - $op USER "$POSTGRES_USER" WITH SUPERUSER $pass + gosu postgres postgres --single -jE <<-EOSQL + $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL + echo + { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then From 51e5166d69320581cb707d6fb102d3ba04803400 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 8 Jan 2015 23:41:38 -0700 Subject: [PATCH 32/42] Switch from pgp.mit.edu to pool.sks-keyservers.net --- 8.4/Dockerfile | 4 ++-- 9.0/Dockerfile | 4 ++-- 9.1/Dockerfile | 4 ++-- 9.2/Dockerfile | 4 ++-- 9.3/Dockerfile | 4 ++-- 9.4/Dockerfile | 4 ++-- Dockerfile.template | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/8.4/Dockerfile b/8.4/Dockerfile index 1ba0a448d6d70..f6034e48c8683 100644 --- a/8.4/Dockerfile +++ b/8.4/Dockerfile @@ -5,7 +5,7 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root -RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 +RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ @@ -21,7 +21,7 @@ ENV LANG en_US.utf8 RUN mkdir /docker-entrypoint-initdb.d -RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 +RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 8.4 ENV PG_VERSION 8.4.22-1.pgdg70+1 diff --git a/9.0/Dockerfile b/9.0/Dockerfile index 6ddcbd60c0cba..d026cd9b33091 100644 --- a/9.0/Dockerfile +++ b/9.0/Dockerfile @@ -5,7 +5,7 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root -RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 +RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ @@ -21,7 +21,7 @@ ENV LANG en_US.utf8 RUN mkdir /docker-entrypoint-initdb.d -RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 +RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.0 ENV PG_VERSION 9.0.18-1.pgdg70+1 diff --git a/9.1/Dockerfile b/9.1/Dockerfile index 7b78548b9b49c..ee28b628b6b50 100644 --- a/9.1/Dockerfile +++ b/9.1/Dockerfile @@ -5,7 +5,7 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root -RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 +RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ @@ -21,7 +21,7 @@ ENV LANG en_US.utf8 RUN mkdir /docker-entrypoint-initdb.d -RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 +RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.1 ENV PG_VERSION 9.1.14-1.pgdg70+1 diff --git a/9.2/Dockerfile b/9.2/Dockerfile index 9c5d46808ca5c..bd73eba442dd8 100644 --- a/9.2/Dockerfile +++ b/9.2/Dockerfile @@ -5,7 +5,7 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root -RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 +RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ @@ -21,7 +21,7 @@ ENV LANG en_US.utf8 RUN mkdir /docker-entrypoint-initdb.d -RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 +RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.2 ENV PG_VERSION 9.2.9-1.pgdg70+1 diff --git a/9.3/Dockerfile b/9.3/Dockerfile index c0dae9e96c932..49635b14e763b 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -5,7 +5,7 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root -RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 +RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ @@ -21,7 +21,7 @@ ENV LANG en_US.utf8 RUN mkdir /docker-entrypoint-initdb.d -RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 +RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.3 ENV PG_VERSION 9.3.5-2.pgdg70+1 diff --git a/9.4/Dockerfile b/9.4/Dockerfile index 92e2752379278..fe3a60efb5ae8 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -5,7 +5,7 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root -RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 +RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ @@ -21,7 +21,7 @@ ENV LANG en_US.utf8 RUN mkdir /docker-entrypoint-initdb.d -RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 +RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.4 ENV PG_VERSION 9.4.0-1.pgdg70+1 diff --git a/Dockerfile.template b/Dockerfile.template index 0ff7b6f269f67..57fc7ed7bb425 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -5,7 +5,7 @@ FROM debian:wheezy RUN groupadd -r postgres && useradd -r -g postgres postgres # grab gosu for easy step-down from root -RUN gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 +RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* \ && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \ && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \ @@ -21,7 +21,7 @@ ENV LANG en_US.utf8 RUN mkdir /docker-entrypoint-initdb.d -RUN apt-key adv --keyserver pgp.mit.edu --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 +RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR %%PG_MAJOR%% ENV PG_VERSION %%PG_VERSION%% From baf80692b5ddd6a5b96876aed7d4b3046ced62ab Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 5 Feb 2015 11:34:14 -0700 Subject: [PATCH 33/42] Update to 9.4.1-1.pgdg70+1, 9.3.6-1.pgdg70+1, 9.2.10-1.pgdg70+1, 9.1.15-1.pgdg70+1, and 9.0.19-1.pgdg70+1 --- 9.0/Dockerfile | 2 +- 9.1/Dockerfile | 2 +- 9.2/Dockerfile | 2 +- 9.3/Dockerfile | 2 +- 9.4/Dockerfile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/9.0/Dockerfile b/9.0/Dockerfile index d026cd9b33091..252b10f3c9483 100644 --- a/9.0/Dockerfile +++ b/9.0/Dockerfile @@ -24,7 +24,7 @@ RUN mkdir /docker-entrypoint-initdb.d RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.0 -ENV PG_VERSION 9.0.18-1.pgdg70+1 +ENV PG_VERSION 9.0.19-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list diff --git a/9.1/Dockerfile b/9.1/Dockerfile index ee28b628b6b50..161a71ce1d436 100644 --- a/9.1/Dockerfile +++ b/9.1/Dockerfile @@ -24,7 +24,7 @@ RUN mkdir /docker-entrypoint-initdb.d RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.1 -ENV PG_VERSION 9.1.14-1.pgdg70+1 +ENV PG_VERSION 9.1.15-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list diff --git a/9.2/Dockerfile b/9.2/Dockerfile index bd73eba442dd8..d06fbfa4fe0bc 100644 --- a/9.2/Dockerfile +++ b/9.2/Dockerfile @@ -24,7 +24,7 @@ RUN mkdir /docker-entrypoint-initdb.d RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.2 -ENV PG_VERSION 9.2.9-1.pgdg70+1 +ENV PG_VERSION 9.2.10-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list diff --git a/9.3/Dockerfile b/9.3/Dockerfile index 49635b14e763b..bdf7866a1fc48 100644 --- a/9.3/Dockerfile +++ b/9.3/Dockerfile @@ -24,7 +24,7 @@ RUN mkdir /docker-entrypoint-initdb.d RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.3 -ENV PG_VERSION 9.3.5-2.pgdg70+1 +ENV PG_VERSION 9.3.6-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list diff --git a/9.4/Dockerfile b/9.4/Dockerfile index fe3a60efb5ae8..27ff03e13ac3f 100644 --- a/9.4/Dockerfile +++ b/9.4/Dockerfile @@ -24,7 +24,7 @@ RUN mkdir /docker-entrypoint-initdb.d RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 ENV PG_MAJOR 9.4 -ENV PG_VERSION 9.4.0-1.pgdg70+1 +ENV PG_VERSION 9.4.1-1.pgdg70+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list From 8e226012531443024caa6cf2497e7be6aade1fc2 Mon Sep 17 00:00:00 2001 From: Justin Garrison Date: Thu, 12 Feb 2015 16:07:53 -0800 Subject: [PATCH 34/42] Added POSTGRES_DB variable to optionally specify DB name --- 8.4/docker-entrypoint.sh | 5 +++-- 9.0/docker-entrypoint.sh | 5 +++-- 9.1/docker-entrypoint.sh | 3 ++- 9.2/docker-entrypoint.sh | 5 +++-- 9.3/docker-entrypoint.sh | 5 +++-- 9.4/docker-entrypoint.sh | 5 +++-- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/8.4/docker-entrypoint.sh b/8.4/docker-entrypoint.sh index 28f8354f7054d..7cfd7763e0f7d 100755 --- a/8.4/docker-entrypoint.sh +++ b/8.4/docker-entrypoint.sh @@ -29,12 +29,13 @@ if [ "$1" = 'postgres' ]; then fi : ${POSTGRES_USER:=postgres} - if [ "$POSTGRES_USER" = 'postgres' ]; then + : ${POSTGRES_DB:=$POSTGRES_USER} + if [ "$POSTGRES_DB" = 'postgres' ]; then op='ALTER' else op='CREATE' gosu postgres postgres --single -jE <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" ; + CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi diff --git a/9.0/docker-entrypoint.sh b/9.0/docker-entrypoint.sh index 28f8354f7054d..201bae2e4ce66 100755 --- a/9.0/docker-entrypoint.sh +++ b/9.0/docker-entrypoint.sh @@ -29,12 +29,13 @@ if [ "$1" = 'postgres' ]; then fi : ${POSTGRES_USER:=postgres} - if [ "$POSTGRES_USER" = 'postgres' ]; then + : ${POSTGRES_DB:=$POSTGRES_USER} + if [ "$POSTGRES_DB" = 'postgres' ]; then op='ALTER' else op='CREATE' gosu postgres postgres --single -jE <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" ; + CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index 28f8354f7054d..4cbb7fec4a478 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -29,12 +29,13 @@ if [ "$1" = 'postgres' ]; then fi : ${POSTGRES_USER:=postgres} + : ${POSTGRES_DB:=$POSTGRES_USER} if [ "$POSTGRES_USER" = 'postgres' ]; then op='ALTER' else op='CREATE' gosu postgres postgres --single -jE <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" ; + CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index 28f8354f7054d..201bae2e4ce66 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -29,12 +29,13 @@ if [ "$1" = 'postgres' ]; then fi : ${POSTGRES_USER:=postgres} - if [ "$POSTGRES_USER" = 'postgres' ]; then + : ${POSTGRES_DB:=$POSTGRES_USER} + if [ "$POSTGRES_DB" = 'postgres' ]; then op='ALTER' else op='CREATE' gosu postgres postgres --single -jE <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" ; + CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index 28f8354f7054d..201bae2e4ce66 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -29,12 +29,13 @@ if [ "$1" = 'postgres' ]; then fi : ${POSTGRES_USER:=postgres} - if [ "$POSTGRES_USER" = 'postgres' ]; then + : ${POSTGRES_DB:=$POSTGRES_USER} + if [ "$POSTGRES_DB" = 'postgres' ]; then op='ALTER' else op='CREATE' gosu postgres postgres --single -jE <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" ; + CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index 28f8354f7054d..201bae2e4ce66 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -29,12 +29,13 @@ if [ "$1" = 'postgres' ]; then fi : ${POSTGRES_USER:=postgres} - if [ "$POSTGRES_USER" = 'postgres' ]; then + : ${POSTGRES_DB:=$POSTGRES_USER} + if [ "$POSTGRES_DB" = 'postgres' ]; then op='ALTER' else op='CREATE' gosu postgres postgres --single -jE <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" ; + CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi From 80fa6827894b0ff10037a56c077da166ca37661b Mon Sep 17 00:00:00 2001 From: Justin Garrison Date: Thu, 12 Feb 2015 16:32:07 -0800 Subject: [PATCH 35/42] retabed files --- 9.0/docker-entrypoint.sh | 2 +- 9.1/docker-entrypoint.sh | 2 +- 9.2/docker-entrypoint.sh | 2 +- 9.3/docker-entrypoint.sh | 2 +- 9.4/docker-entrypoint.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/9.0/docker-entrypoint.sh b/9.0/docker-entrypoint.sh index 201bae2e4ce66..7cfd7763e0f7d 100755 --- a/9.0/docker-entrypoint.sh +++ b/9.0/docker-entrypoint.sh @@ -29,7 +29,7 @@ if [ "$1" = 'postgres' ]; then fi : ${POSTGRES_USER:=postgres} - : ${POSTGRES_DB:=$POSTGRES_USER} + : ${POSTGRES_DB:=$POSTGRES_USER} if [ "$POSTGRES_DB" = 'postgres' ]; then op='ALTER' else diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index 4cbb7fec4a478..34708b0f4c777 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -29,7 +29,7 @@ if [ "$1" = 'postgres' ]; then fi : ${POSTGRES_USER:=postgres} - : ${POSTGRES_DB:=$POSTGRES_USER} + : ${POSTGRES_DB:=$POSTGRES_USER} if [ "$POSTGRES_USER" = 'postgres' ]; then op='ALTER' else diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index 201bae2e4ce66..7cfd7763e0f7d 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -29,7 +29,7 @@ if [ "$1" = 'postgres' ]; then fi : ${POSTGRES_USER:=postgres} - : ${POSTGRES_DB:=$POSTGRES_USER} + : ${POSTGRES_DB:=$POSTGRES_USER} if [ "$POSTGRES_DB" = 'postgres' ]; then op='ALTER' else diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index 201bae2e4ce66..7cfd7763e0f7d 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -29,7 +29,7 @@ if [ "$1" = 'postgres' ]; then fi : ${POSTGRES_USER:=postgres} - : ${POSTGRES_DB:=$POSTGRES_USER} + : ${POSTGRES_DB:=$POSTGRES_USER} if [ "$POSTGRES_DB" = 'postgres' ]; then op='ALTER' else diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index 201bae2e4ce66..7cfd7763e0f7d 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -29,7 +29,7 @@ if [ "$1" = 'postgres' ]; then fi : ${POSTGRES_USER:=postgres} - : ${POSTGRES_DB:=$POSTGRES_USER} + : ${POSTGRES_DB:=$POSTGRES_USER} if [ "$POSTGRES_DB" = 'postgres' ]; then op='ALTER' else From 167c2ae96307923f4eded82b62a5997514d664aa Mon Sep 17 00:00:00 2001 From: Justin Garrison Date: Fri, 13 Feb 2015 09:44:07 -0800 Subject: [PATCH 36/42] missed variable in 9.1 entrypoint.sh --- 9.1/docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index 34708b0f4c777..7cfd7763e0f7d 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -30,7 +30,7 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ "$POSTGRES_USER" = 'postgres' ]; then + if [ "$POSTGRES_DB" = 'postgres' ]; then op='ALTER' else op='CREATE' From c863eb347143c15223d58d619c316f8ec3cb8556 Mon Sep 17 00:00:00 2001 From: Justin Garrison Date: Fri, 13 Feb 2015 09:54:07 -0800 Subject: [PATCH 37/42] updated template docker-entrypoint --- docker-entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 28f8354f7054d..74a4e356fceb5 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -29,7 +29,8 @@ if [ "$1" = 'postgres' ]; then fi : ${POSTGRES_USER:=postgres} - if [ "$POSTGRES_USER" = 'postgres' ]; then + : ${POSTGRES_DB:=$POSTGRES_USER} + if [ "$POSTGRES_DB" = 'postgres' ]; then op='ALTER' else op='CREATE' From 1438bacac69b4f72efc6a943011e8cb5ce45e991 Mon Sep 17 00:00:00 2001 From: Justin Garrison Date: Fri, 13 Feb 2015 11:17:55 -0800 Subject: [PATCH 38/42] Forgot CREATE DATABASE variable --- docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 74a4e356fceb5..7cfd7763e0f7d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -35,7 +35,7 @@ if [ "$1" = 'postgres' ]; then else op='CREATE' gosu postgres postgres --single -jE <<-EOSQL - CREATE DATABASE "$POSTGRES_USER" ; + CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi From 8f80834e934b7deaccabb7bf81876190d72800f8 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Wed, 11 Feb 2015 15:12:11 -0800 Subject: [PATCH 39/42] Update pg_hba generation --- 8.4/docker-entrypoint.sh | 8 +++++++- 9.0/docker-entrypoint.sh | 8 +++++++- 9.1/docker-entrypoint.sh | 8 +++++++- 9.2/docker-entrypoint.sh | 8 +++++++- 9.3/docker-entrypoint.sh | 8 +++++++- 9.4/docker-entrypoint.sh | 8 +++++++- docker-entrypoint.sh | 8 +++++++- 7 files changed, 49 insertions(+), 7 deletions(-) diff --git a/8.4/docker-entrypoint.sh b/8.4/docker-entrypoint.sh index 28f8354f7054d..ed1f2c72924ab 100755 --- a/8.4/docker-entrypoint.sh +++ b/8.4/docker-entrypoint.sh @@ -19,6 +19,12 @@ if [ "$1" = 'postgres' ]; then cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. + This will allow anyone with access to the + Postgres port to access your database. In + Docker's default configuration, this is + effectively any other container on the same + system. + Use "-e POSTGRES_PASSWORD=password" to set it in "docker run". **************************************************** @@ -44,7 +50,7 @@ if [ "$1" = 'postgres' ]; then EOSQL echo - { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + { echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do diff --git a/9.0/docker-entrypoint.sh b/9.0/docker-entrypoint.sh index 28f8354f7054d..ed1f2c72924ab 100755 --- a/9.0/docker-entrypoint.sh +++ b/9.0/docker-entrypoint.sh @@ -19,6 +19,12 @@ if [ "$1" = 'postgres' ]; then cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. + This will allow anyone with access to the + Postgres port to access your database. In + Docker's default configuration, this is + effectively any other container on the same + system. + Use "-e POSTGRES_PASSWORD=password" to set it in "docker run". **************************************************** @@ -44,7 +50,7 @@ if [ "$1" = 'postgres' ]; then EOSQL echo - { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + { echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index 28f8354f7054d..ed1f2c72924ab 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -19,6 +19,12 @@ if [ "$1" = 'postgres' ]; then cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. + This will allow anyone with access to the + Postgres port to access your database. In + Docker's default configuration, this is + effectively any other container on the same + system. + Use "-e POSTGRES_PASSWORD=password" to set it in "docker run". **************************************************** @@ -44,7 +50,7 @@ if [ "$1" = 'postgres' ]; then EOSQL echo - { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + { echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index 28f8354f7054d..ed1f2c72924ab 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -19,6 +19,12 @@ if [ "$1" = 'postgres' ]; then cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. + This will allow anyone with access to the + Postgres port to access your database. In + Docker's default configuration, this is + effectively any other container on the same + system. + Use "-e POSTGRES_PASSWORD=password" to set it in "docker run". **************************************************** @@ -44,7 +50,7 @@ if [ "$1" = 'postgres' ]; then EOSQL echo - { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + { echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index 28f8354f7054d..ed1f2c72924ab 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -19,6 +19,12 @@ if [ "$1" = 'postgres' ]; then cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. + This will allow anyone with access to the + Postgres port to access your database. In + Docker's default configuration, this is + effectively any other container on the same + system. + Use "-e POSTGRES_PASSWORD=password" to set it in "docker run". **************************************************** @@ -44,7 +50,7 @@ if [ "$1" = 'postgres' ]; then EOSQL echo - { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + { echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index 28f8354f7054d..ed1f2c72924ab 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -19,6 +19,12 @@ if [ "$1" = 'postgres' ]; then cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. + This will allow anyone with access to the + Postgres port to access your database. In + Docker's default configuration, this is + effectively any other container on the same + system. + Use "-e POSTGRES_PASSWORD=password" to set it in "docker run". **************************************************** @@ -44,7 +50,7 @@ if [ "$1" = 'postgres' ]; then EOSQL echo - { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + { echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 28f8354f7054d..ed1f2c72924ab 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -19,6 +19,12 @@ if [ "$1" = 'postgres' ]; then cat >&2 <<-'EOWARN' **************************************************** WARNING: No password has been set for the database. + This will allow anyone with access to the + Postgres port to access your database. In + Docker's default configuration, this is + effectively any other container on the same + system. + Use "-e POSTGRES_PASSWORD=password" to set it in "docker run". **************************************************** @@ -44,7 +50,7 @@ if [ "$1" = 'postgres' ]; then EOSQL echo - { echo; echo "host all \"$POSTGRES_USER\" 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf + { echo; echo "host all all 0.0.0.0/0 $authMethod"; } >> "$PGDATA"/pg_hba.conf if [ -d /docker-entrypoint-initdb.d ]; then for f in /docker-entrypoint-initdb.d/*.sh; do From 5950846753f33a321d09b408686d4e99973f6210 Mon Sep 17 00:00:00 2001 From: Justin Garrison Date: Fri, 13 Feb 2015 23:30:13 -0800 Subject: [PATCH 40/42] Fixed checks for USER/DB combinations :ok_hand::squirrel: --- 8.4/docker-entrypoint.sh | 12 ++++++++---- 9.0/docker-entrypoint.sh | 12 ++++++++---- 9.1/docker-entrypoint.sh | 12 ++++++++---- 9.2/docker-entrypoint.sh | 12 ++++++++---- 9.3/docker-entrypoint.sh | 12 ++++++++---- 9.4/docker-entrypoint.sh | 12 ++++++++---- docker-entrypoint.sh | 12 ++++++++---- 7 files changed, 56 insertions(+), 28 deletions(-) diff --git a/8.4/docker-entrypoint.sh b/8.4/docker-entrypoint.sh index 7cfd7763e0f7d..cd78dd84500c0 100755 --- a/8.4/docker-entrypoint.sh +++ b/8.4/docker-entrypoint.sh @@ -30,16 +30,20 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ "$POSTGRES_DB" = 'postgres' ]; then - op='ALTER' - else - op='CREATE' + + if [ ! "$POSTGRES_DB" = 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + fi + gosu postgres postgres --single -jE <<-EOSQL $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL diff --git a/9.0/docker-entrypoint.sh b/9.0/docker-entrypoint.sh index 7cfd7763e0f7d..cd78dd84500c0 100755 --- a/9.0/docker-entrypoint.sh +++ b/9.0/docker-entrypoint.sh @@ -30,16 +30,20 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ "$POSTGRES_DB" = 'postgres' ]; then - op='ALTER' - else - op='CREATE' + + if [ ! "$POSTGRES_DB" = 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + fi + gosu postgres postgres --single -jE <<-EOSQL $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index 7cfd7763e0f7d..cd78dd84500c0 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -30,16 +30,20 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ "$POSTGRES_DB" = 'postgres' ]; then - op='ALTER' - else - op='CREATE' + + if [ ! "$POSTGRES_DB" = 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + fi + gosu postgres postgres --single -jE <<-EOSQL $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index 7cfd7763e0f7d..cd78dd84500c0 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -30,16 +30,20 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ "$POSTGRES_DB" = 'postgres' ]; then - op='ALTER' - else - op='CREATE' + + if [ ! "$POSTGRES_DB" = 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + fi + gosu postgres postgres --single -jE <<-EOSQL $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index 7cfd7763e0f7d..cd78dd84500c0 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -30,16 +30,20 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ "$POSTGRES_DB" = 'postgres' ]; then - op='ALTER' - else - op='CREATE' + + if [ ! "$POSTGRES_DB" = 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + fi + gosu postgres postgres --single -jE <<-EOSQL $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index 7cfd7763e0f7d..cd78dd84500c0 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -30,16 +30,20 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ "$POSTGRES_DB" = 'postgres' ]; then - op='ALTER' - else - op='CREATE' + + if [ ! "$POSTGRES_DB" = 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + fi + gosu postgres postgres --single -jE <<-EOSQL $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 7cfd7763e0f7d..cd78dd84500c0 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -30,16 +30,20 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ "$POSTGRES_DB" = 'postgres' ]; then - op='ALTER' - else - op='CREATE' + + if [ ! "$POSTGRES_DB" = 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL echo fi + if [ "$POSTGRES_USER" = 'postgres' ]; then + op='ALTER' + else + op='CREATE' + fi + gosu postgres postgres --single -jE <<-EOSQL $op USER "$POSTGRES_USER" WITH SUPERUSER $pass ; EOSQL From 796f3f151eb0817c541b357df024678088efd9cb Mon Sep 17 00:00:00 2001 From: Justin Garrison Date: Thu, 19 Feb 2015 22:37:53 -0800 Subject: [PATCH 41/42] "!...=" != "!=" :exclamation: --- 8.4/docker-entrypoint.sh | 2 +- 9.0/docker-entrypoint.sh | 2 +- 9.1/docker-entrypoint.sh | 2 +- 9.2/docker-entrypoint.sh | 2 +- 9.3/docker-entrypoint.sh | 2 +- 9.4/docker-entrypoint.sh | 2 +- docker-entrypoint.sh | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/8.4/docker-entrypoint.sh b/8.4/docker-entrypoint.sh index cd78dd84500c0..da128fc38faf9 100755 --- a/8.4/docker-entrypoint.sh +++ b/8.4/docker-entrypoint.sh @@ -31,7 +31,7 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ ! "$POSTGRES_DB" = 'postgres' ]; then + if [ "$POSTGRES_DB" != 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL diff --git a/9.0/docker-entrypoint.sh b/9.0/docker-entrypoint.sh index cd78dd84500c0..da128fc38faf9 100755 --- a/9.0/docker-entrypoint.sh +++ b/9.0/docker-entrypoint.sh @@ -31,7 +31,7 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ ! "$POSTGRES_DB" = 'postgres' ]; then + if [ "$POSTGRES_DB" != 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL diff --git a/9.1/docker-entrypoint.sh b/9.1/docker-entrypoint.sh index cd78dd84500c0..da128fc38faf9 100755 --- a/9.1/docker-entrypoint.sh +++ b/9.1/docker-entrypoint.sh @@ -31,7 +31,7 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ ! "$POSTGRES_DB" = 'postgres' ]; then + if [ "$POSTGRES_DB" != 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL diff --git a/9.2/docker-entrypoint.sh b/9.2/docker-entrypoint.sh index cd78dd84500c0..da128fc38faf9 100755 --- a/9.2/docker-entrypoint.sh +++ b/9.2/docker-entrypoint.sh @@ -31,7 +31,7 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ ! "$POSTGRES_DB" = 'postgres' ]; then + if [ "$POSTGRES_DB" != 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL diff --git a/9.3/docker-entrypoint.sh b/9.3/docker-entrypoint.sh index cd78dd84500c0..da128fc38faf9 100755 --- a/9.3/docker-entrypoint.sh +++ b/9.3/docker-entrypoint.sh @@ -31,7 +31,7 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ ! "$POSTGRES_DB" = 'postgres' ]; then + if [ "$POSTGRES_DB" != 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL diff --git a/9.4/docker-entrypoint.sh b/9.4/docker-entrypoint.sh index cd78dd84500c0..da128fc38faf9 100755 --- a/9.4/docker-entrypoint.sh +++ b/9.4/docker-entrypoint.sh @@ -31,7 +31,7 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ ! "$POSTGRES_DB" = 'postgres' ]; then + if [ "$POSTGRES_DB" != 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index cd78dd84500c0..da128fc38faf9 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -31,7 +31,7 @@ if [ "$1" = 'postgres' ]; then : ${POSTGRES_USER:=postgres} : ${POSTGRES_DB:=$POSTGRES_USER} - if [ ! "$POSTGRES_DB" = 'postgres' ]; then + if [ "$POSTGRES_DB" != 'postgres' ]; then gosu postgres postgres --single -jE <<-EOSQL CREATE DATABASE "$POSTGRES_DB" ; EOSQL From 57de8c8cd8cab23af68e8d09a20909efe11924f9 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 23 Feb 2015 13:50:50 -0700 Subject: [PATCH 42/42] 2015 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index f86b1322e63ac..4f324b2254fa5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014, Docker PostgreSQL Authors (See AUTHORS) +Copyright (c) 2014-2015, Docker PostgreSQL Authors (See AUTHORS) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation