mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
In order to develop and test WAL replication, we need the wal2json module installed in our dev postgres image. The module itself builds very quickly, but I thought it would be better to have this automatically built and pushed as part of a nightly job so that CI and developers can make use of it.
20 lines
602 B
Docker
20 lines
602 B
Docker
# Builds a Postgres image with needed extensions and modules for local development
|
|
|
|
# Install wal2json
|
|
ARG POSTGRES_VERSION=15
|
|
FROM postgres:${POSTGRES_VERSION}-alpine AS builder
|
|
RUN apk add --no-cache \
|
|
build-base \
|
|
git \
|
|
llvm \
|
|
clang \
|
|
curl
|
|
ARG WAL2JSON_VERSION=2_6
|
|
RUN curl -fssL https://github.com/eulerto/wal2json/archive/refs/tags/wal2json_${WAL2JSON_VERSION}.tar.gz | tar -xzf - -C /tmp --strip-components=1
|
|
WORKDIR /tmp
|
|
RUN USE_PGXS=1 make && make install
|
|
|
|
# Prepare final image
|
|
FROM postgres:${POSTGRES_VERSION}-alpine
|
|
COPY --from=builder /tmp/wal2json.so /usr/local/lib/postgresql/
|