@@ -730,10 +730,13 @@ ADD "https://github.com/supabase/supautils/releases/download/v${supautils_releas
730730# ###################
731731FROM base as walg
732732ARG 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 && \
735738 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
737740
738741# ###################
739742# Collect extension packages
@@ -793,14 +796,19 @@ COPY --chown=postgres:postgres ansible/files/postgresql_config/postgresql-stdout
793796COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
794797COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
795798COPY --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
796802
797803RUN sed -i "s/#unix_socket_directories = '\/ tmp'/unix_socket_directories = '\/ var\/ run\/ postgresql'/g" /etc/postgresql/postgresql.conf && \
798804 sed -i "s/#session_preload_libraries = ''/session_preload_libraries = 'supautils'/g" /etc/postgresql/postgresql.conf && \
799805 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 && \
800807 echo "cron.database_name = 'postgres'" >> /etc/postgresql/postgresql.conf && \
801808 echo "pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-${TARGETARCH}/lib/server/libjvm.so'" >> /etc/postgresql/postgresql.conf && \
802809 echo "pgsodium.getkey_script= '/usr/lib/postgresql/${postgresql_major}/bin/pgsodium_getkey.sh'" >> /etc/postgresql/postgresql.conf && \
803810 echo 'auto_explain.log_min_duration = 10s' >> /etc/postgresql/postgresql.conf && \
811+ useradd --create-home --shell /bin/bash wal-g -G postgres && \
804812 mkdir -p /etc/postgresql-custom && \
805813 chown postgres:postgres /etc/postgresql-custom
806814
0 commit comments