diff --git a/.travis.yml b/.travis.yml index be5eecfdc..4e640c8d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -132,7 +132,6 @@ matrix: - docker build --compress -t epicmorg/balancer:php balancer/php - docker push epicmorg/balancer:php -########## - name: Apache + PHP7.3 script: @@ -146,6 +145,51 @@ matrix: - docker build --compress -t epicmorg/websites:php7.2 websites/php7.2 - docker push epicmorg/websites:php7.2 +########## + + - name: PostgresSQL 8.2, 8.3, 8.4, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 10, 11, 12 + script: + - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + - docker build --compress -t epicmorg/postgres:8.2 postgres/8.2 + - docker push epicmorg/postgres:8.2 + + - docker build --compress -t epicmorg/postgres:8.3 postgres/8.3 + - docker push epicmorg/postgres:8.3 + + - docker build --compress -t epicmorg/postgres:8.4 postgres/8.4 + - docker push epicmorg/postgres:8.4 + + - docker build --compress -t epicmorg/postgres:9.0 postgres/9.0 + - docker push epicmorg/postgres:9.0 + + - docker build --compress -t epicmorg/postgres:9.1 postgres/9.1 + - docker push epicmorg/postgres:9.1 + + - docker build --compress -t epicmorg/postgres:9.2 postgres/9.2 + - docker push epicmorg/postgres:9.2 + + - docker build --compress -t epicmorg/postgres:9.3 postgres/9.3 + - docker push epicmorg/postgres:9.3 + + - docker build --compress -t epicmorg/postgres:9.4 postgres/9.4 + - docker push epicmorg/postgres:9.4 + + - docker build --compress -t epicmorg/postgres:9.5 postgres/9.5 + - docker push epicmorg/postgres:9.5 + + - docker build --compress -t epicmorg/postgres:9.6 postgres/9.6 + - docker push epicmorg/postgres:9.6 + + - docker build --compress -t epicmorg/postgres:10 postgres/10 + - docker push epicmorg/postgres:10 + + - docker build --compress -t epicmorg/postgres:11 postgres/11 + - docker push epicmorg/postgres:11 + + - docker build --compress -t epicmorg/postgres:12 postgres/12 + - docker push epicmorg/postgres:12 + + ########## - name: Bitbucket (latest) @@ -164,14 +208,18 @@ matrix: - docker build --compress -t epicmorg/confluence:latest-jdk11 -f atlassian/confluence/latest/Dockerfile.jdk11 atlassian/confluence/latest - docker push epicmorg/confluence:latest-jdk11 - - name: Jira (latest) - script: - - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + - docker build --compress -t epicmorg/jira:latest atlassian/jira/latest - docker push epicmorg/jira:latest - docker build --compress -t epicmorg/jira:latest-jdk11 -f atlassian/jira/latest/Dockerfile.jdk11 atlassian/jira/latest - docker push epicmorg/jira:latest-jdk11 - + + - name: Postgres (latest) + script: + - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin + - docker build --compress -t epicmorg/postgres:latest postgres/latest + - docker push epicmorg/postgres:latest + ########## - name: qBitTorrent [latest + unstable + stable] @@ -1500,9 +1548,3 @@ matrix: #### Our minor priority images ######################################### - - name: PostgresSQL 9.3 - script: - - echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin - - docker build --compress -t epicmorg/postgres:9.3 postgres/9.3 - - docker push epicmorg/postgres:9.3 - diff --git a/postgres/10/Dockerfile b/postgres/10/Dockerfile new file mode 100644 index 000000000..02682bed4 --- /dev/null +++ b/postgres/10/Dockerfile @@ -0,0 +1,59 @@ +FROM epicmorg/edge +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +#################################################################################################################################### +# 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 + +#################################################################################################################################### +# 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.11/gosu-amd64' \ + && chmod +x /usr/local/bin/gosu \ + + && apt-get purge -y --auto-remove curl + +#################################################################################################################################### +# 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 keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 + +#################################################################################################################################### +# http://apt.postgresql.org/pub/repos/apt/pool/10/p/postgresql-10/ +#################################################################################################################################### +ENV PG_MAJOR 10 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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 \ + postgresql-contrib-$PG_MAJOR \ + && rm -rf /var/lib/apt/lists/* + +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 + +COPY ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/postgres/10/Makefile b/postgres/10/Makefile new file mode 100644 index 000000000..26d5594b1 --- /dev/null +++ b/postgres/10/Makefile @@ -0,0 +1,4 @@ +all: pssql +pssql: + docker build --compress -t epicmorg/postgres:10 . + docker push epicmorg/postgres:10 diff --git a/postgres/10/docker-entrypoint.sh b/postgres/10/docker-entrypoint.sh new file mode 100755 index 000000000..8011908ac --- /dev/null +++ b/postgres/10/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/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 + + 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 "$@" +fi + +exec "$@" diff --git a/postgres/11/Dockerfile b/postgres/11/Dockerfile new file mode 100644 index 000000000..dbee12bf6 --- /dev/null +++ b/postgres/11/Dockerfile @@ -0,0 +1,59 @@ +FROM epicmorg/edge +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +#################################################################################################################################### +# 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 + +#################################################################################################################################### +# 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.11/gosu-amd64' \ + && chmod +x /usr/local/bin/gosu \ + + && apt-get purge -y --auto-remove curl + +#################################################################################################################################### +# 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 keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 + +#################################################################################################################################### +# http://apt.postgresql.org/pub/repos/apt/pool/11/p/postgresql-11/ +#################################################################################################################################### +ENV PG_MAJOR 11 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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 \ + postgresql-contrib-$PG_MAJOR \ + && rm -rf /var/lib/apt/lists/* + +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 + +COPY ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/postgres/11/Makefile b/postgres/11/Makefile new file mode 100644 index 000000000..b3239da7d --- /dev/null +++ b/postgres/11/Makefile @@ -0,0 +1,4 @@ +all: pssql +pssql: + docker build --compress -t epicmorg/postgres:11 . + docker push epicmorg/postgres:11 diff --git a/postgres/11/docker-entrypoint.sh b/postgres/11/docker-entrypoint.sh new file mode 100755 index 000000000..8011908ac --- /dev/null +++ b/postgres/11/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/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 + + 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 "$@" +fi + +exec "$@" diff --git a/postgres/12/Dockerfile b/postgres/12/Dockerfile new file mode 100644 index 000000000..37bdbc0ed --- /dev/null +++ b/postgres/12/Dockerfile @@ -0,0 +1,59 @@ +FROM epicmorg/edge +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +#################################################################################################################################### +# 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 + +#################################################################################################################################### +# 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.11/gosu-amd64' \ + && chmod +x /usr/local/bin/gosu \ + + && apt-get purge -y --auto-remove curl + +#################################################################################################################################### +# 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 keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 + +#################################################################################################################################### +# http://apt.postgresql.org/pub/repos/apt/pool/12/p/postgresql-12/ +#################################################################################################################################### +ENV PG_MAJOR 12 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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 \ + postgresql-contrib-$PG_MAJOR \ + && rm -rf /var/lib/apt/lists/* + +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 + +COPY ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/postgres/12/Makefile b/postgres/12/Makefile new file mode 100644 index 000000000..8c7a5103e --- /dev/null +++ b/postgres/12/Makefile @@ -0,0 +1,4 @@ +all: pssql +pssql: + docker build --compress -t epicmorg/postgres:12 . + docker push epicmorg/postgres:12 diff --git a/postgres/12/docker-entrypoint.sh b/postgres/12/docker-entrypoint.sh new file mode 100755 index 000000000..8011908ac --- /dev/null +++ b/postgres/12/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/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 + + 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 "$@" +fi + +exec "$@" diff --git a/postgres/8.2/Dockerfile b/postgres/8.2/Dockerfile new file mode 100644 index 000000000..480d00bbc --- /dev/null +++ b/postgres/8.2/Dockerfile @@ -0,0 +1,59 @@ +FROM epicmorg/edge +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +#################################################################################################################################### +# 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 + +#################################################################################################################################### +# 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.11/gosu-amd64' \ + && chmod +x /usr/local/bin/gosu \ + + && apt-get purge -y --auto-remove curl + +#################################################################################################################################### +# 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 keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 + +#################################################################################################################################### +# http://apt.postgresql.org/pub/repos/apt/pool/8.2/p/postgresql-8.2/ +#################################################################################################################################### +ENV PG_MAJOR 8.2 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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 \ + postgresql-contrib-$PG_MAJOR \ + && rm -rf /var/lib/apt/lists/* + +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 + +COPY ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/postgres/8.2/Makefile b/postgres/8.2/Makefile new file mode 100644 index 000000000..0d259a8fd --- /dev/null +++ b/postgres/8.2/Makefile @@ -0,0 +1,5 @@ +all: pssql +pssql: + docker build --compress -t epicmorg/postgres:8.2 . + docker push epicmorg/postgres:8.2 + diff --git a/postgres/8.2/docker-entrypoint.sh b/postgres/8.2/docker-entrypoint.sh new file mode 100755 index 000000000..8011908ac --- /dev/null +++ b/postgres/8.2/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/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 + + 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 "$@" +fi + +exec "$@" diff --git a/postgres/8.3/Dockerfile b/postgres/8.3/Dockerfile new file mode 100644 index 000000000..f28443396 --- /dev/null +++ b/postgres/8.3/Dockerfile @@ -0,0 +1,61 @@ +FROM epicmorg/edge +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +#################################################################################################################################### +# 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 + +#################################################################################################################################### +# 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.11/gosu-amd64' \ + && chmod +x /usr/local/bin/gosu \ + + && apt-get purge -y --auto-remove curl + +#################################################################################################################################### +# 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 keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 + +#################################################################################################################################### +# http://apt.postgresql.org/pub/repos/apt/pool/8.3/p/postgresql-8.3/ +#################################################################################################################################### +ENV PG_MAJOR 8.3 +ENV PG_VERSION 8.3 + + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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 \ + postgresql-contrib-$PG_MAJOR \ + && rm -rf /var/lib/apt/lists/* + +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 + +COPY ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/postgres/8.3/Makefile b/postgres/8.3/Makefile new file mode 100644 index 000000000..4ed0cf075 --- /dev/null +++ b/postgres/8.3/Makefile @@ -0,0 +1,5 @@ +all: pssql +pssql: + docker build --compress -t epicmorg/postgres:8.3 . + docker push epicmorg/postgres:8.3 + diff --git a/postgres/8.3/docker-entrypoint.sh b/postgres/8.3/docker-entrypoint.sh new file mode 100755 index 000000000..8011908ac --- /dev/null +++ b/postgres/8.3/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/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 + + 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 "$@" +fi + +exec "$@" diff --git a/postgres/8.4/Dockerfile b/postgres/8.4/Dockerfile index d3be0ad93..0dc019a3c 100644 --- a/postgres/8.4/Dockerfile +++ b/postgres/8.4/Dockerfile @@ -1,37 +1,53 @@ -# vim:set ft=dockerfile: -FROM debian:wheezy +FROM epicmorg/edge +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive +#################################################################################################################################### # 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 +#################################################################################################################################### # 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 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.11/gosu-amd64' \ + && chmod +x /usr/local/bin/gosu \ + + && apt-get purge -y --auto-remove curl + +#################################################################################################################################### # 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 + && 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 +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 +#################################################################################################################################### +# http://apt.postgresql.org/pub/repos/apt/pool/8.4/p/postgresql-8.4/ +#################################################################################################################################### 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 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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 \ - && rm -rf /var/lib/apt/lists/* + && 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 \ + postgresql-contrib-$PG_MAJOR \ + && rm -rf /var/lib/apt/lists/* 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 @@ -42,3 +58,4 @@ ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 5432 CMD ["postgres"] + diff --git a/postgres/8.4/Makefile b/postgres/8.4/Makefile new file mode 100644 index 000000000..f13d9c1aa --- /dev/null +++ b/postgres/8.4/Makefile @@ -0,0 +1,5 @@ +all: pssql +pssql: + docker build --compress -t epicmorg/postgres:8.4 . + docker push epicmorg/postgres:8.4 + diff --git a/postgres/9.0/Dockerfile b/postgres/9.0/Dockerfile index 927494498..518b49018 100644 --- a/postgres/9.0/Dockerfile +++ b/postgres/9.0/Dockerfile @@ -1,37 +1,53 @@ -# vim:set ft=dockerfile: -FROM debian:wheezy +FROM epicmorg/edge +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive +#################################################################################################################################### # 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 +#################################################################################################################################### # 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 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.11/gosu-amd64' \ + && chmod +x /usr/local/bin/gosu \ + + && apt-get purge -y --auto-remove curl + +#################################################################################################################################### # 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 + && 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 +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 +#################################################################################################################################### +# http://apt.postgresql.org/pub/repos/apt/pool/9.0/p/postgresql-9.0/ +#################################################################################################################################### 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 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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 \ - && rm -rf /var/lib/apt/lists/* + && 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 \ + postgresql-contrib-$PG_MAJOR \ + && rm -rf /var/lib/apt/lists/* 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 @@ -42,3 +58,4 @@ ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 5432 CMD ["postgres"] + diff --git a/postgres/9.0/Makefile b/postgres/9.0/Makefile new file mode 100644 index 000000000..beb2ca99b --- /dev/null +++ b/postgres/9.0/Makefile @@ -0,0 +1,5 @@ +all: pssql +pssql: + docker build --compress -t epicmorg/postgres:9.0 . + docker push epicmorg/postgres:9.0 + diff --git a/postgres/9.1/Dockerfile b/postgres/9.1/Dockerfile index b58fbdd6e..49ad56e2f 100644 --- a/postgres/9.1/Dockerfile +++ b/postgres/9.1/Dockerfile @@ -1,37 +1,53 @@ -# vim:set ft=dockerfile: -FROM debian:wheezy +FROM epicmorg/edge +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive +#################################################################################################################################### # 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 +#################################################################################################################################### # 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 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.11/gosu-amd64' \ + && chmod +x /usr/local/bin/gosu \ + + && apt-get purge -y --auto-remove curl + +#################################################################################################################################### # 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 + && 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 +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 +#################################################################################################################################### +# http://apt.postgresql.org/pub/repos/apt/pool/9.0/p/postgresql-9.0/ +#################################################################################################################################### 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 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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 \ - && rm -rf /var/lib/apt/lists/* + && 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 \ + postgresql-contrib-$PG_MAJOR \ + && rm -rf /var/lib/apt/lists/* 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 @@ -42,3 +58,4 @@ ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 5432 CMD ["postgres"] + diff --git a/postgres/9.1/Makefile b/postgres/9.1/Makefile new file mode 100644 index 000000000..5fa68bbe8 --- /dev/null +++ b/postgres/9.1/Makefile @@ -0,0 +1,5 @@ +all: pssql +pssql: + docker build --compress -t epicmorg/postgres:9.1 . + docker push epicmorg/postgres:9.1 + diff --git a/postgres/9.2/Dockerfile b/postgres/9.2/Dockerfile index 91bd7a326..d99fa5c81 100644 --- a/postgres/9.2/Dockerfile +++ b/postgres/9.2/Dockerfile @@ -1,37 +1,53 @@ -# vim:set ft=dockerfile: -FROM debian:wheezy +FROM epicmorg/edge +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive +#################################################################################################################################### # 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 +#################################################################################################################################### # 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 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.11/gosu-amd64' \ + && chmod +x /usr/local/bin/gosu \ + + && apt-get purge -y --auto-remove curl + +#################################################################################################################################### # 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 + && 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 +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 +#################################################################################################################################### +# http://apt.postgresql.org/pub/repos/apt/pool/9.2/p/postgresql-9.2/ +#################################################################################################################################### 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 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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 \ - && rm -rf /var/lib/apt/lists/* + && 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 \ + postgresql-contrib-$PG_MAJOR \ + && rm -rf /var/lib/apt/lists/* 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 @@ -42,3 +58,4 @@ ENTRYPOINT ["/docker-entrypoint.sh"] EXPOSE 5432 CMD ["postgres"] + diff --git a/postgres/9.2/Makefile b/postgres/9.2/Makefile new file mode 100644 index 000000000..beb2ca99b --- /dev/null +++ b/postgres/9.2/Makefile @@ -0,0 +1,5 @@ +all: pssql +pssql: + docker build --compress -t epicmorg/postgres:9.0 . + docker push epicmorg/postgres:9.0 + diff --git a/postgres/9.3/Dockerfile b/postgres/9.3/Dockerfile index 5c11ebb9a..d32d7f120 100644 --- a/postgres/9.3/Dockerfile +++ b/postgres/9.3/Dockerfile @@ -32,17 +32,16 @@ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F # http://apt.postgresql.org/pub/repos/apt/pool/9.3/p/postgresql-9.3/ #################################################################################################################################### ENV PG_MAJOR 9.3 -ENV PG_VERSION 9.3.25-3.pgdg+1 RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ - echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing main' $PG_MAJOR >> /etc/apt/sources.list.d/pgdg.lis + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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-$PG_MAJOR \ + postgresql-contrib-$PG_MAJOR \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql diff --git a/postgres/9.4/Dockerfile b/postgres/9.4/Dockerfile index 0b22b529d..6303faaab 100644 --- a/postgres/9.4/Dockerfile +++ b/postgres/9.4/Dockerfile @@ -1,37 +1,52 @@ -# vim:set ft=dockerfile: -FROM debian:wheezy +FROM epicmorg/edge +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive +#################################################################################################################################### # 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 +#################################################################################################################################### # 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 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.11/gosu-amd64' \ + && chmod +x /usr/local/bin/gosu \ + + && apt-get purge -y --auto-remove curl + +#################################################################################################################################### # 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 + && 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 +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 +#################################################################################################################################### +# http://apt.postgresql.org/pub/repos/apt/pool/9.4/p/postgresql-9.4/ +#################################################################################################################################### ENV PG_MAJOR 9.4 -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 +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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 \ - && rm -rf /var/lib/apt/lists/* + && 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 \ + postgresql-contrib-$PG_MAJOR \ + && rm -rf /var/lib/apt/lists/* 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/postgres/9.4/Makefile b/postgres/9.4/Makefile new file mode 100644 index 000000000..a825612b1 --- /dev/null +++ b/postgres/9.4/Makefile @@ -0,0 +1,4 @@ +all: pssql +pssql: + docker build --compress -t epicmorg/postgres:9.4 . + docker push epicmorg/postgres:9.4 diff --git a/postgres/9.5/Dockerfile b/postgres/9.5/Dockerfile new file mode 100644 index 000000000..2e5b0b5bd --- /dev/null +++ b/postgres/9.5/Dockerfile @@ -0,0 +1,59 @@ +FROM epicmorg/edge +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +#################################################################################################################################### +# 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 + +#################################################################################################################################### +# 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.11/gosu-amd64' \ + && chmod +x /usr/local/bin/gosu \ + + && apt-get purge -y --auto-remove curl + +#################################################################################################################################### +# 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 keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 + +#################################################################################################################################### +# http://apt.postgresql.org/pub/repos/apt/pool/9.4/p/postgresql-9.4/ +#################################################################################################################################### +ENV PG_MAJOR 9.5 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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 \ + postgresql-contrib-$PG_MAJOR \ + && rm -rf /var/lib/apt/lists/* + +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 + +COPY ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/postgres/9.5/Makefile b/postgres/9.5/Makefile new file mode 100644 index 000000000..93943e48d --- /dev/null +++ b/postgres/9.5/Makefile @@ -0,0 +1,4 @@ +all: pssql +pssql: + docker build --compress -t epicmorg/postgres:9.5 . + docker push epicmorg/postgres:9.5 diff --git a/postgres/9.5/docker-entrypoint.sh b/postgres/9.5/docker-entrypoint.sh new file mode 100755 index 000000000..8011908ac --- /dev/null +++ b/postgres/9.5/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/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 + + 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 "$@" +fi + +exec "$@" diff --git a/postgres/9.6/Dockerfile b/postgres/9.6/Dockerfile new file mode 100644 index 000000000..db4cc69e0 --- /dev/null +++ b/postgres/9.6/Dockerfile @@ -0,0 +1,59 @@ +FROM epicmorg/edge +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +#################################################################################################################################### +# 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 + +#################################################################################################################################### +# 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.11/gosu-amd64' \ + && chmod +x /usr/local/bin/gosu \ + + && apt-get purge -y --auto-remove curl + +#################################################################################################################################### +# 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 keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 + +#################################################################################################################################### +# http://apt.postgresql.org/pub/repos/apt/pool/9.6/p/postgresql-9.6/ +#################################################################################################################################### +ENV PG_MAJOR 9.6 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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 \ + postgresql-contrib-$PG_MAJOR \ + && rm -rf /var/lib/apt/lists/* + +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 + +COPY ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/postgres/9.6/Makefile b/postgres/9.6/Makefile new file mode 100644 index 000000000..5fc65e35e --- /dev/null +++ b/postgres/9.6/Makefile @@ -0,0 +1,4 @@ +all: pssql +pssql: + docker build --compress -t epicmorg/postgres:9.6 . + docker push epicmorg/postgres:9.6 diff --git a/postgres/9.6/docker-entrypoint.sh b/postgres/9.6/docker-entrypoint.sh new file mode 100755 index 000000000..8011908ac --- /dev/null +++ b/postgres/9.6/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/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 + + 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 "$@" +fi + +exec "$@" diff --git a/postgres/latest/Dockerfile b/postgres/latest/Dockerfile new file mode 100644 index 000000000..37bdbc0ed --- /dev/null +++ b/postgres/latest/Dockerfile @@ -0,0 +1,59 @@ +FROM epicmorg/edge +LABEL maintainer="EpicMorg DevTeam, developer@epicm.org" +ARG DEBIAN_FRONTEND=noninteractive + +#################################################################################################################################### +# 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 + +#################################################################################################################################### +# 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.11/gosu-amd64' \ + && chmod +x /usr/local/bin/gosu \ + + && apt-get purge -y --auto-remove curl + +#################################################################################################################################### +# 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 keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8 + +#################################################################################################################################### +# http://apt.postgresql.org/pub/repos/apt/pool/12/p/postgresql-12/ +#################################################################################################################################### +ENV PG_MAJOR 12 + +RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list && \ + echo 'deb http://apt.postgresql.org/pub/repos/apt/ sid-pgdg-testing 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 \ + postgresql-contrib-$PG_MAJOR \ + && rm -rf /var/lib/apt/lists/* + +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 + +COPY ./docker-entrypoint.sh / + +ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5432 +CMD ["postgres"] diff --git a/postgres/latest/Makefile b/postgres/latest/Makefile new file mode 100644 index 000000000..55729c4e9 --- /dev/null +++ b/postgres/latest/Makefile @@ -0,0 +1,4 @@ +all: pssql +pssql: + docker build --compress -t epicmorg/postgres:latest . + docker push epicmorg/postgres:latest diff --git a/postgres/latest/docker-entrypoint.sh b/postgres/latest/docker-entrypoint.sh new file mode 100755 index 000000000..8011908ac --- /dev/null +++ b/postgres/latest/docker-entrypoint.sh @@ -0,0 +1,24 @@ +#!/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 + + 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 "$@" +fi + +exec "$@"