|
|
|
|
@@ -1,57 +1,4 @@
|
|
|
|
|
FROM debian:trixie-slim
|
|
|
|
|
|
|
|
|
|
RUN set -eux; \
|
|
|
|
|
groupadd -r postgres --gid=5432; \
|
|
|
|
|
useradd -r -g postgres --uid=5432 --home-dir=/var/lib/postgresql --shell=/bin/bash postgres; \
|
|
|
|
|
install --verbose --directory --owner postgres --group postgres --mode 1755 /var/lib/postgresql
|
|
|
|
|
|
|
|
|
|
RUN apt-get update; \
|
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
|
openssh-server \
|
|
|
|
|
sudo \
|
|
|
|
|
; \
|
|
|
|
|
rm -rf /var/lib/apt/lists/*; \
|
|
|
|
|
echo "postgres ALL = (ALL) NOPASSWD:ALL" >> /etc/sudoers; \
|
|
|
|
|
echo "X11Forwarding no" >> /etc/ssh/sshd_config; \
|
|
|
|
|
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config; \
|
|
|
|
|
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
|
|
|
|
|
|
|
|
|
|
RUN set -eux; \
|
|
|
|
|
grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
|
|
|
|
|
sed -ri '/\/usr\/share\/locale/d' /etc/dpkg/dpkg.cfg.d/docker; \
|
|
|
|
|
! grep -q '/usr/share/locale' /etc/dpkg/dpkg.cfg.d/docker; \
|
|
|
|
|
apt-get update; \
|
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
|
locales; \
|
|
|
|
|
rm -rf /var/lib/apt/lists/*; \
|
|
|
|
|
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen; \
|
|
|
|
|
locale-gen; \
|
|
|
|
|
locale -a | grep 'en_US.utf8'
|
|
|
|
|
ENV LANG=en_US.utf8
|
|
|
|
|
|
|
|
|
|
ENV GOSU_VERSION=1.19
|
|
|
|
|
RUN set -eux; \
|
|
|
|
|
savedAptMark="$(apt-mark showmanual)"; \
|
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
|
ca-certificates \
|
|
|
|
|
wget \
|
|
|
|
|
gnupg \
|
|
|
|
|
; \
|
|
|
|
|
rm -rf /var/lib/apt/lists/*; \
|
|
|
|
|
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
|
|
|
|
|
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${dpkgArch}"; \
|
|
|
|
|
wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${dpkgArch}.asc"; \
|
|
|
|
|
export GNUPGHOME="$(mktemp -d)"; \
|
|
|
|
|
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
|
|
|
|
|
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
|
|
|
|
|
gpgconf --kill all; \
|
|
|
|
|
rm -rf "${GNUPGHOME}" /usr/local/bin/gosu.asc; \
|
|
|
|
|
apt-mark auto '.*' > /dev/null; \
|
|
|
|
|
[ -z "${savedAptMark}" ] || apt-mark manual "${savedAptMark}" > /dev/null; \
|
|
|
|
|
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
|
|
|
|
|
chmod +x /usr/local/bin/gosu; \
|
|
|
|
|
gosu --version; \
|
|
|
|
|
gosu nobody true
|
|
|
|
|
FROM pendragon.zone/docker/pg15
|
|
|
|
|
|
|
|
|
|
RUN set -ex; \
|
|
|
|
|
apt-get update; \
|
|
|
|
|
@@ -78,7 +25,6 @@ ENV PG_VERSION=15.16-1.pgdg13+1
|
|
|
|
|
ENV PGDATA=/var/lib/postgresql/data
|
|
|
|
|
|
|
|
|
|
RUN install --verbose --directory --owner postgres --group postgres --mode 3777 /var/run/postgresql; \
|
|
|
|
|
install --verbose --directory --owner postgres --group postgres --mode 3755 /var/lib/postgresql; \
|
|
|
|
|
install --verbose --directory --owner postgres --group postgres --mode 1700 "${PGDATA}"
|
|
|
|
|
|
|
|
|
|
RUN set -ex; \
|
|
|
|
|
@@ -106,7 +52,6 @@ RUN set -eux; \
|
|
|
|
|
|
|
|
|
|
VOLUME /var/lib/postgresql/data
|
|
|
|
|
|
|
|
|
|
COPY --chown=postgres:postgres postgres /var/lib/postgresql/
|
|
|
|
|
COPY --chmod=755 entrypoint.sh /usr/local/bin/
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["entrypoint.sh"]
|
|
|
|
|
|