Skip to content

Commit ed3a4c3

Browse files
committed
chore: update dockerfiles
1 parent 2761d73 commit ed3a4c3

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

Dockerfile-15

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,14 @@ ENV PGDATA=/var/lib/postgresql/data
120120
####################
121121
FROM base as walg
122122
ARG wal_g_release
123-
# ADD "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-${TARGETARCH}.tar.gz" /tmp/wal-g.tar.gz
124-
RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH") && \
125-
apt-get update && apt-get install -y --no-install-recommends curl && \
126-
curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-aarch64.tar.gz" -o /tmp/wal-g.tar.gz && \
127-
tar -xvf /tmp/wal-g.tar.gz -C /tmp && \
128-
rm -rf /tmp/wal-g.tar.gz && \
129-
mv /tmp/wal-g-pg-ubuntu*20.04-aarch64 /tmp/wal-g
123+
WORKDIR /nixpg
124+
125+
RUN nix profile install .#wal-g-3 && \
126+
ln -s /nix/var/nix/profiles/default/bin/wal-g-3 /tmp/wal-g
130127

128+
RUN nix store gc
129+
130+
WORKDIR /
131131
# ####################
132132
# # Download gosu for easy step-down from root
133133
# ####################
@@ -179,7 +179,8 @@ RUN sed -i \
179179
-e "s|#include = '/etc/postgresql-custom/wal-g.conf'|include = '/etc/postgresql-custom/wal-g.conf'|g" /etc/postgresql/postgresql.conf && \
180180
echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \
181181
#echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \
182-
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
182+
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
183+
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
183184
echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
184185
usermod -aG postgres wal-g && \
185186
mkdir -p /etc/postgresql-custom && \
@@ -219,4 +220,7 @@ ENV LC_ALL en_US.UTF-8
219220
ENV LC_CTYPE=C.UTF-8
220221
ENV LC_COLLATE=C.UTF-8
221222
ENV LOCALE_ARCHIVE /usr/lib/locale/locale-archive
223+
RUN mkdir -p /usr/share/postgresql/extension/ && \
224+
ln -s /usr/lib/postgresql/bin/pgsodium_getkey.sh /usr/share/postgresql/extension/pgsodium_getkey && \
225+
chmod +x /usr/lib/postgresql/bin/pgsodium_getkey.sh
222226
CMD ["postgres", "-D", "/etc/postgresql"]

Dockerfile-orioledb-17

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ARG pgvector_release=0.4.0
3737
ARG pg_tle_release=1.3.2
3838
ARG index_advisor_release=0.2.0
3939
ARG supautils_release=2.2.0
40-
ARG wal_g_release=2.0.1
40+
ARG wal_g_release=3.0.5
4141

4242
FROM ubuntu:focal as base
4343

@@ -118,14 +118,15 @@ ENV PGDATA=/var/lib/postgresql/data
118118
####################
119119
FROM base as walg
120120
ARG wal_g_release
121-
# ADD "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-${TARGETARCH}.tar.gz" /tmp/wal-g.tar.gz
122-
RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH") && \
123-
apt-get update && apt-get install -y --no-install-recommends curl && \
124-
curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-aarch64.tar.gz" -o /tmp/wal-g.tar.gz && \
125-
tar -xvf /tmp/wal-g.tar.gz -C /tmp && \
126-
rm -rf /tmp/wal-g.tar.gz && \
127-
mv /tmp/wal-g-pg-ubuntu*20.04-aarch64 /tmp/wal-g
128121

122+
WORKDIR /nixpg
123+
124+
RUN nix profile install .#wal-g-3 && \
125+
ln -s /nix/var/nix/profiles/default/bin/wal-g-3 /tmp/wal-g
126+
127+
RUN nix store gc
128+
129+
WORKDIR /
129130
# ####################
130131
# # Download gosu for easy step-down from root
131132
# ####################
@@ -178,6 +179,7 @@ RUN sed -i \
178179
echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \
179180
#echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \
180181
echo "pgsodium.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
182+
echo "vault.getkey_script= '/usr/lib/postgresql/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
181183
echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
182184
usermod -aG postgres wal-g && \
183185
mkdir -p /etc/postgresql-custom && \
@@ -231,4 +233,8 @@ ENV LC_ALL en_US.UTF-8
231233
ENV LC_CTYPE=C.UTF-8
232234
ENV LC_COLLATE=C.UTF-8
233235
ENV LOCALE_ARCHIVE /usr/lib/locale/locale-archive
236+
RUN mkdir -p /usr/share/postgresql/extension/ && \
237+
ln -s /usr/lib/postgresql/bin/pgsodium_getkey.sh /usr/share/postgresql/extension/pgsodium_getkey && \
238+
chmod +x /usr/lib/postgresql/bin/pgsodium_getkey.sh
239+
234240
CMD ["postgres", "-D", "/etc/postgresql"]

0 commit comments

Comments
 (0)