8000 fix: download and configure walg for arm64 · tkpte/supabase-postgres@b96d741 · GitHub
[go: up one dir, main page]

Skip to content

Commit b96d741

Browse files
committed
fix: download and configure walg for arm64
1 parent 1c18a01 commit b96d741

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,10 +730,13 @@ ADD "https://github.com/supabase/supautils/releases/download/v${supautils_releas
730730
####################
731731
FROM base as walg
732732
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 && \
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
793796
COPY --chown=postgres:postgres ansible/files/postgresql_config/supautils.conf.j2 /etc/postgresql-custom/supautils.conf
794797
COPY --chown=postgres:postgres ansible/files/postgresql_extension_custom_scripts /etc/postgresql-custom/extension-custom-scripts
795798
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
796802

797803
RUN 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

Comments
 (0)
0