From 6fdf029eca7a99d287259ad693397fa74e265cdb Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 14 May 2018 20:17:53 +0200 Subject: [PATCH 1/3] added support for hypopg --- 9.6/Dockerfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/9.6/Dockerfile b/9.6/Dockerfile index 3b96768453..47ee7a5d67 100644 --- a/9.6/Dockerfile +++ b/9.6/Dockerfile @@ -133,6 +133,18 @@ ENV PGDATA /var/lib/postgresql/data RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 777 "$PGDATA" # this 777 will be replaced by 700 at runtime (allows semi-arbitrary "--user" values) VOLUME /var/lib/postgresql/data + +RUN apt-get update && apt-get install -y git wget zip postgresql-server-dev-9.6 build-essential + +# HypoPG is a PostgreSQL extension, adding support for Hypothetical Indexes. It’s compatible with PostgreSQL 9.2 and above. +# it is used by the latest version of SIDES +RUN cd /usr/local/src && \ + wget https://github.com/HypoPG/hypopg/archive/master.zip && \ + unzip master.zip && \ + cd /usr/local/src/hypopg-master && \ + make && \ + make install + COPY docker-entrypoint.sh /usr/local/bin/ RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat ENTRYPOINT ["docker-entrypoint.sh"] From ade071e5260de004b247bf8cf6f313776b1f4af0 Mon Sep 17 00:00:00 2001 From: Adam Sanchez Date: Mon, 11 Feb 2019 11:00:49 +0100 Subject: [PATCH 2/3] added suport for HypoPG for versions 10 and 11 --- 10/Dockerfile | 10 ++++++++++ 11/Dockerfile | 21 ++++++++++++++++----- 9.6/Dockerfile | 16 ++++++++-------- 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/10/Dockerfile b/10/Dockerfile index 1eba8042eb..2934dd9259 100644 --- a/10/Dockerfile +++ b/10/Dockerfile @@ -167,6 +167,16 @@ ENV PGDATA /var/lib/postgresql/data RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 777 "$PGDATA" # this 777 will be replaced by 700 at runtime (allows semi-arbitrary "--user" values) VOLUME /var/lib/postgresql/data +# HypoPG is a PostgreSQL extension, adding support for Hypothetical Indexes. It’s compatible with PostgreSQL 9.2 and above. +# it is used by the latest version of SIDES +RUN apt-get update && apt-get install -y git wget zip postgresql-server-dev-9.6 build-essential +RUN cd /usr/local/src && \ + wget https://github.com/HypoPG/hypopg/archive/master.zip && \ + unzip master.zip && \ + cd /usr/local/src/hypopg-master && \ + make && \ + make install + COPY docker-entrypoint.sh /usr/local/bin/ RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/11/Dockerfile b/11/Dockerfile index 7b5aee305d..c221b6d2ce 100644 --- a/11/Dockerfile +++ b/11/Dockerfile @@ -5,7 +5,7 @@ RUN set -ex; \ if ! command -v gpg > /dev/null; then \ apt-get update; \ apt-get install -y --no-install-recommends \ - gnupg \ + gnupg2 \ dirmngr \ ; \ rm -rf /var/lib/apt/lists/*; \ @@ -28,8 +28,8 @@ RUN set -x \ && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ && export GNUPGHOME="$(mktemp -d)" \ - && gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ - && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ + && gpg2 --batch --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ + && gpg2 --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu \ @@ -64,8 +64,8 @@ RUN set -ex; \ # uid PostgreSQL Debian Repository key='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8'; \ export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - gpg --batch --export "$key" > /etc/apt/trusted.gpg.d/postgres.gpg; \ + gpg2 --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + gpg2 --batch --export "$key" > /etc/apt/trusted.gpg.d/postgres.gpg; \ command -v gpgconf > /dev/null && gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ apt-key list @@ -167,6 +167,17 @@ ENV PGDATA /var/lib/postgresql/data RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 777 "$PGDATA" # this 777 will be replaced by 700 at runtime (allows semi-arbitrary "--user" values) VOLUME /var/lib/postgresql/data +# HypoPG is a PostgreSQL extension, adding support for Hypothetical Indexes. It’s compatible with PostgreSQL 9.2 and above. +# it is used by the latest version of SIDES +RUN apt-get update && apt-get install -y git wget zip postgresql-server-dev-9.6 build-essential +RUN cd /usr/local/src && \ + wget https://github.com/HypoPG/hypopg/archive/master.zip && \ + unzip master.zip && \ + cd /usr/local/src/hypopg-master && \ + make && \ + make install + + COPY docker-entrypoint.sh /usr/local/bin/ RUN ln -s usr/local/bin/docker-entrypoint.sh / # backwards compat ENTRYPOINT ["docker-entrypoint.sh"] diff --git a/9.6/Dockerfile b/9.6/Dockerfile index d4325d8b76..eed3655d42 100644 --- a/9.6/Dockerfile +++ b/9.6/Dockerfile @@ -5,7 +5,7 @@ RUN set -ex; \ if ! command -v gpg > /dev/null; then \ apt-get update; \ apt-get install -y --no-install-recommends \ - gnupg \ + gnupg2 \ dirmngr \ ; \ rm -rf /var/lib/apt/lists/*; \ @@ -24,17 +24,17 @@ RUN set -eux; \ # grab gosu for easy step-down from root ENV GOSU_VERSION 1.11 RUN set -x \ - && apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \ + && apt-get update && apt-get install -y --no-install-recommends ca-certificates wget unzip && rm -rf /var/lib/apt/lists/* \ && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ && export GNUPGHOME="$(mktemp -d)" \ - && gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ - && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ + && gpg2 --batch --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ + && gpg2 --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ && { command -v gpgconf > /dev/null && gpgconf --kill all || :; } \ && rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu \ && gosu nobody true \ - && apt-get purge -y --auto-remove ca-certificates wget + && apt-get purge -y --auto-remove # make the "en_US.UTF-8" locale so postgres will be utf-8 enabled by default RUN set -eux; \ @@ -64,8 +64,8 @@ RUN set -ex; \ # uid PostgreSQL Debian Repository key='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8'; \ export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ - gpg --batch --export "$key" > /etc/apt/trusted.gpg.d/postgres.gpg; \ + gpg2 --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ + gpg2 --batch --export "$key" > /etc/apt/trusted.gpg.d/postgres.gpg; \ command -v gpgconf > /dev/null && gpgconf --kill all; \ rm -rf "$GNUPGHOME"; \ apt-key list @@ -169,10 +169,10 @@ RUN mkdir -p "$PGDATA" && chown -R postgres:postgres "$PGDATA" && chmod 777 "$PG VOLUME /var/lib/postgresql/data -RUN apt-get update && apt-get install -y git wget zip postgresql-server-dev-9.6 build-essential # HypoPG is a PostgreSQL extension, adding support for Hypothetical Indexes. It’s compatible with PostgreSQL 9.2 and above. # it is used by the latest version of SIDES +RUN apt-get update && apt-get install -y git wget zip postgresql-server-dev-9.6 build-essential RUN cd /usr/local/src && \ wget https://github.com/HypoPG/hypopg/archive/master.zip && \ unzip master.zip && \ From c1d9de6e98ec2798836c6fabbd3bfcc6ce7b0a60 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 11 Feb 2019 09:02:04 -0500 Subject: [PATCH 3/3] fixed version for dev packages --- 10/Dockerfile | 2 +- 11/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/10/Dockerfile b/10/Dockerfile index 2934dd9259..0e7deb23c6 100644 --- a/10/Dockerfile +++ b/10/Dockerfile @@ -169,7 +169,7 @@ VOLUME /var/lib/postgresql/data # HypoPG is a PostgreSQL extension, adding support for Hypothetical Indexes. It’s compatible with PostgreSQL 9.2 and above. # it is used by the latest version of SIDES -RUN apt-get update && apt-get install -y git wget zip postgresql-server-dev-9.6 build-essential +RUN apt-get update && apt-get install -y git wget zip postgresql-server-dev-10 build-essential RUN cd /usr/local/src && \ wget https://github.com/HypoPG/hypopg/archive/master.zip && \ unzip master.zip && \ diff --git a/11/Dockerfile b/11/Dockerfile index c221b6d2ce..47b06914c9 100644 --- a/11/Dockerfile +++ b/11/Dockerfile @@ -169,7 +169,7 @@ VOLUME /var/lib/postgresql/data # HypoPG is a PostgreSQL extension, adding support for Hypothetical Indexes. It’s compatible with PostgreSQL 9.2 and above. # it is used by the latest version of SIDES -RUN apt-get update && apt-get install -y git wget zip postgresql-server-dev-9.6 build-essential +RUN apt-get update && apt-get install -y git wget zip postgresql-server-dev-11 build-essential RUN cd /usr/local/src && \ wget https://github.com/HypoPG/hypopg/archive/master.zip && \ unzip master.zip && \