@@ -730,10 +730,13 @@ ADD "https://github.com/supabase/supautils/releases/download/v${supautils_releas
730
730
# ###################
731
731
FROM base as walg
732
732
ARG wal_g_release
733
- 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
734
- RUN tar -xvf /tmp/wal-g.tar.gz -C /tmp && \
733
+ # 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
734
+ RUN arch=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "$TARGETARCH" ) && \
735
+ apt-get update && apt-get install -y --no-install-recommends curl && \
736
+ curl -kL "https://github.com/wal-g/wal-g/releases/download/v${wal_g_release}/wal-g-pg-ubuntu-20.04-${arch}.tar.gz" -o /tmp/wal-g.tar.gz && \
737
+ tar -xvf /tmp/wal-g.tar.gz -C /tmp && \
735
738
rm -rf /tmp/wal-g.tar.gz && \
736
- mv /tmp/wal-g-pg-ubuntu-20.04-${TARGETARCH} /tmp/wal-g
739
+ mv /tmp/wal-g-pg-ubuntu-20.04-$arch /tmp/wal-g
737
740
738
741
# ###################
739
742
# Collect extension packages
@@ -793,14 +796,19 @@ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout
793
796
COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
794
797
COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
795
798
COPY --chown=postgres:postgres ansible/files/pgsodium_getkey_urandom.sh.j2 /usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh
799
+ COPY --chown=postgres:postgres ansible/files/postgresql_config/custom_walg.conf.j2 /etc/postgresql-custom/wal-g.conf
800
+ COPY --chown=postgres:postgres ansible/files/walg_helper_scripts/wal_fetch.sh /home/postgres/wal_fetch.sh
801
+ COPY ansible/files/walg_helper_scripts/wal_change_ownership.sh /root/wal_change_ownership.sh
796
802
797
803
RUN sed -i "s/#unix_socket_directories = '\/ tmp'/unix_socket_directories = '\/ var\/ run\/ postgresql'/g" /etc/postgresql/postgresql.conf && \
798
804
sed -i "s/#session_preload_libraries = ''/session_preload_libraries = 'supautils'/g" /etc/postgresql/postgresql.conf && \
799
805
sed -i "s/#include = '\/ etc\/ postgresql-custom\/ supautils.conf'/include = '\/ etc\/ postgresql-custom\/ supautils.conf'/g" /etc/postgresql/postgresql.conf && \
806
+ sed -i "s/#include = '\/ etc\/ postgresql-custom\/ wal-g.conf''/include = '\/ etc\/ postgresql-custom\/ wal-g.conf'/g" /etc/postgresql/postgresql.conf && \
800
807
echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \
801
808
echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \
802
809
echo "pgsodium.getkey_script= '/usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
803
810
echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
811
+ useradd --create-home --shell /bin/bash wal-g -G postgres && \
804
812
mkdir -p /etc/postgresql-custom && \
805
813
chown postgres:postgres /etc/postgresql-custom
806
814
0 commit comments