Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ARG REGISTRY=docker-dev-local.intern.net
- ARG BASE_IMAGE_REPO=scm
- ARG BASE_IMAGE_NAME=debian-bullseye
- ARG BASE_IMAGE_TAG=latest
- # Second stage - create runtime image
- # -----------------------------------
- #FROM debian:11 as base
- #FROM docker-dev-local.intern.net/scm/debian-bullseye:build-74 as base
- FROM $REGISTRY/$BASE_IMAGE_REPO/$BASE_IMAGE_NAME:$BASE_IMAGE_TAG
- # Maintainer
- # ----------
- LABEL org.opencontainers.image.authors="<[email protected]>"
- # Build Environment variables, change as needed
- # -------------------------------------------------------------
- ARG PG_MAJOR=14
- ARG PG_VERSION=14.1
- ARG DIST_VERSION=deb11
- ARG DVZ_BUILD=dvz1
- ENV DVZ_REPO_URL=http://dvzsn-rd1115.dbmon.intern.net/scb-repo
- # Environment variables required for this build (do NOT change)
- # -------------------------------------------------------------
- ENV PG_MAJOR=${PG_MAJOR}
- ENV PG_VERSION=${PG_VERSION}
- ENV PGUSER=postgres
- ENV PGDATABASE=postgres
- ENV PGPORT=5432
- ENV DBBASE=/opt/db
- ENV PGBASE=$DBBASE/postgres
- ENV PGBIN=$PGBASE/bin
- ENV PGHOME=$PGBASE/postgresql
- ENV PGDATA=$DBBASE/data/postgres/data
- ENV PGLOG=$PGDATA/log
- ENV PGBACK=$DBBASE/backup/postgres/backups
- ENV PGARCH=$DBBASE/backup/postgres/archives
- ENV PATH=$PGHOME/bin:$PATH
- ENV LANG=de_DE.UTF-8
- ENV LC_MESSAGES=en_US.UTF-8
- ENV TZ=Europe/Berlin
- RUN env | sort
- # Install additional packages and dependencies
- # --------------------------------------------
- RUN set -ex; \
- apt-get update && \
- apt-get upgrade && \
- apt-get install -y --no-install-recommends \
- ca-certificates \
- curl \
- dirmngr \
- gnupg \
- iproute2 \
- less \
- libnss-wrapper \
- libpam0g \
- libreadline8 \
- libselinux1 \
- libsystemd0 \
- libxml2 \
- locales \
- openssl \
- procps \
- vim-tiny \
- wget \
- xz-utils \
- zlib1g \
- && \
- apt-get clean
- # create locales for en_US and de_DE
- RUN localedef -i en_US -f UTF-8 en_US.UTF-8 && \
- localedef -i de_DE -f UTF-8 de_DE.UTF-8 && \
- locale -a
- # Set up user and directories
- # ---------------------------
- RUN mkdir -p $PGBASE $PGBIN $PGDATA $PGBACK $PGARCH && \
- useradd -d /home/postgres -m -s /bin/bash --no-log-init postgres && \
- chown -R postgres:postgres $PGBASE $PGDATA $PGBACK $PGARCH $DBBASE/data && \
- chmod a+xr $PGBASE
- # set up user env
- # ---------------
- USER postgres
- COPY --chown=postgres:postgres ["files/.alias", "files/.bashrc", "files/postgresql.conf.${PG_MAJOR}", "files/conf.d/00-ina-default.conf", "/hom
- COPY ["files/docker-entrypoint.sh", "/"]
- ADD ["files/pg-docker-env.tar.gz", "$PGBASE/"]
- # install postgres
- # --------------------
- # copy postgres package from builder stage
- #RUN mkdir -p $PGBASE/postgresql-$PG_VERSION-$DIST_VERSION-$DVZ_BUILD
- #COPY --from=build --chown=postgres:postgres ["$PGBASE/postgresql-$PG_VERSION-$DIST_VERSION-$DVZ_BUILD", "$PGBASE/postgresql-$PG_VERSION-$DIST_
- # download build of postgres
- WORKDIR $PGBASE
- RUN curl -sSL $DVZ_REPO_URL/postgres/Linux/$DIST_VERSION/postgresql-$PG_VERSION-$DIST_VERSION-dvz1.tar.gz | tar xzf - -C $PGBASE
- RUN ln -s $PGBASE/postgresql-$PG_VERSION-$DIST_VERSION-$DVZ_BUILD postgresql
- # bindings
- # --------
- VOLUME ["$PGDATA", "$PGBACK", "$PGARCH"]
- STOPSIGNAL SIGINT
- EXPOSE 5432
- HEALTHCHECK --interval=1m --start-period=5m \
- CMD pg_ctl status >/dev/null || exit 1
- # Define default command to start Database.
- ENTRYPOINT ["/docker-entrypoint.sh"]
- CMD ["postgres", "-D", "/opt/db/data/postgres/data"]
Add Comment
Please, Sign In to add comment