-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
matthias
committed
Feb 15, 2023
1 parent
8f6215e
commit 962e863
Showing
19 changed files
with
1,451 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
ARG CONTAINERSUITE | ||
ARG BUILD | ||
|
||
FROM ${CONTAINERSUITE}/base:0.0.${BUILD} | ||
|
||
# Dockerfile specific informations | ||
ARG PACKAGER | ||
ARG BASEOS | ||
ARG PGBACKREST_VERSION | ||
ARG PG_MAJOR | ||
|
||
RUN if [ "$BASEOS" = "ubi8" ] ; then \ | ||
${PACKAGER} -y install --nodocs \ | ||
shadow-utils \ | ||
tar \ | ||
bzip2 \ | ||
lz4 \ | ||
#crunchy-backrest-${BACKREST_VER} \ | ||
&& ${PACKAGER} -y clean all ; \ | ||
else \ | ||
${PACKAGER} -y install --nodocs \ | ||
--setopt=skip_missing_names_on_install=False \ | ||
bzip2 \ | ||
lz4 \ | ||
nano \ | ||
git \ | ||
go \ | ||
dumb-init \ | ||
&& ${PACKAGER} -y clean all ; \ | ||
fi | ||
|
||
RUN git clone https://github.com/prometheus-community/postgres_exporter.git && cd postgres_exporter && make build | ||
COPY launcher/exporter/launch.sh / | ||
COPY scripts/exporter/queries/ /postgres_exporter/queries | ||
|
||
ENTRYPOINT ["/usr/bin/dumb-init", "--"] | ||
|
||
CMD ["/bin/sh", "/launch.sh", "init"] | ||
#CMD ["/bin/sh", "/scripts/postgres/promote.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
ARG BASE_IMAGE=ubuntu:22.04 | ||
ARG PGVERSION=15 | ||
ARG TIMESCALEDB="1.7.5 2.3.1 2.9.2" | ||
ARG DEMO=false | ||
ARG COMPRESS=false | ||
ARG ADDITIONAL_LOCALES= | ||
ARG CONTAINERSUITE | ||
ARG BUILD | ||
|
||
|
||
FROM ${CONTAINERSUITE}/base:0.0.${BUILD} as base | ||
|
||
ARG ADDITIONAL_LOCALES | ||
|
||
COPY build_scripts/locales.sh /builddeps/ | ||
|
||
RUN bash /builddeps/locales.sh | ||
|
||
|
||
FROM ${CONTAINERSUITE}/base:0.0.${BUILD} as dependencies-builder | ||
|
||
ARG DEMO | ||
|
||
ENV WALG_VERSION=v2.0.1 | ||
|
||
COPY build_scripts/dependencies.sh /builddeps/ | ||
|
||
COPY dependencies/debs /builddeps/ | ||
|
||
RUN bash /builddeps/dependencies.sh | ||
|
||
|
||
FROM ${CONTAINERSUITE}/base:0.0.${BUILD} as builder-false | ||
|
||
ARG DEMO | ||
ARG ADDITIONAL_LOCALES | ||
|
||
COPY build_scripts/prepare.sh build_scripts/locales.sh /builddeps/ | ||
|
||
RUN bash /builddeps/prepare.sh | ||
|
||
COPY --from=base /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.18 | ||
|
||
COPY cron_unprivileged.c dependencies/src /builddeps/ | ||
COPY build_scripts/base.sh /builddeps/ | ||
COPY --from=dependencies-builder /builddeps/*.deb /builddeps/ | ||
|
||
ARG PGVERSION | ||
ARG TIMESCALEDB | ||
ARG TIMESCALEDB_APACHE_ONLY=true | ||
ARG TIMESCALEDB_TOOLKIT=true | ||
ARG COMPRESS | ||
ARG PGOLDVERSIONS="10 11 12 13 14" | ||
ARG WITH_PERL=false | ||
|
||
ARG DEB_PG_SUPPORTED_VERSIONS="$PGOLDVERSIONS $PGVERSION" | ||
|
||
# Install PostgreSQL, extensions and contribs | ||
ENV POSTGIS_VERSION=3.3 \ | ||
POSTGIS_LEGACY=3.2 \ | ||
BG_MON_COMMIT=241d8134e4dda4ffe6f21d40abf8d544d78bc9d8 \ | ||
PG_AUTH_MON_COMMIT=439697fe2980cf48f1760f45e04c2d69b2748e73 \ | ||
PG_MON_COMMIT=34c35a86e6dea26930bf1f770048cea2c695b80b \ | ||
SET_USER=REL3_0_0 \ | ||
PLPROFILER=REL4_2_1 \ | ||
PG_PROFILE=4.1 \ | ||
PAM_OAUTH2=v1.0.1 \ | ||
PLANTUNER_COMMIT=800d81bc85da64ff3ef66e12aed1d4e1e54fc006 \ | ||
PG_PERMISSIONS_COMMIT=314b9359e3d77c0b2ef7dbbde97fa4be80e31925 \ | ||
PG_TM_AUX_COMMIT=51cf42f6043608919802fcc48458471d0ea3a127 | ||
|
||
WORKDIR /builddeps | ||
RUN bash base.sh | ||
|
||
# Install wal-g | ||
COPY --from=dependencies-builder /builddeps/wal-g /usr/local/bin/ | ||
|
||
COPY build_scripts/patroni_wale.sh build_scripts/compress_build.sh /builddeps/ | ||
|
||
# Install patroni and wal-e | ||
ENV PATRONIVERSION=3.0.0 | ||
ENV WALE_VERSION=1.1.1 | ||
|
||
WORKDIR / | ||
|
||
RUN bash /builddeps/patroni_wale.sh | ||
|
||
RUN if [ "$COMPRESS" = "true" ]; then bash /builddeps/compress_build.sh; fi | ||
|
||
|
||
FROM scratch as builder-true | ||
COPY --from=builder-false / / | ||
|
||
|
||
FROM builder-${COMPRESS} | ||
|
||
LABEL maintainer="Polina Bungina <[email protected]>" | ||
|
||
ARG PGVERSION | ||
ARG TIMESCALEDB | ||
ARG DEMO | ||
ARG COMPRESS | ||
|
||
EXPOSE 5432 8008 8080 | ||
|
||
ENV LC_ALL=en_US.utf-8 \ | ||
PATH=$PATH:/usr/lib/postgresql/$PGVERSION/bin \ | ||
PGHOME=/home/postgres \ | ||
RW_DIR=/run \ | ||
TIMESCALEDB=$TIMESCALEDB \ | ||
DEMO=$DEMO | ||
|
||
ENV WALE_ENV_DIR=$RW_DIR/etc/wal-e.d/env \ | ||
LOG_ENV_DIR=$RW_DIR/etc/log.d/env \ | ||
PGROOT=$PGHOME/pgdata/pgroot | ||
|
||
ENV PGDATA=$PGROOT/data \ | ||
PGLOG=$PGROOT/pg_log | ||
|
||
ENV USE_OLD_LOCALES=false | ||
|
||
WORKDIR $PGHOME | ||
|
||
COPY motd /etc/ | ||
COPY runit /etc/service/ | ||
COPY pgq_ticker.ini $PGHOME/ | ||
COPY build_scripts/post_build.sh /builddeps/ | ||
|
||
RUN sh /builddeps/post_build.sh && rm -rf /builddeps/ | ||
|
||
COPY scripts bootstrap major_upgrade /scripts/ | ||
COPY launch.sh / | ||
|
||
CMD ["/bin/sh", "/launch.sh", "init"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.