-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile.pkg.j2
More file actions
69 lines (57 loc) · 2.6 KB
/
Copy pathContainerfile.pkg.j2
File metadata and controls
69 lines (57 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
ARG PG_VERSION=18
# Builder: pgaudit from source
FROM ghcr.io/daemonless/postgres:${PG_VERSION} AS builder-pgaudit
ARG PG_VERSION
ARG PGAUDIT_VERSION
RUN pkg update && pkg install -y \
FreeBSD-bmake FreeBSD-clibs-dev FreeBSD-clang FreeBSD-clang-dev FreeBSD-toolchain \
gmake pkgconf openssl && \
pkg clean -ay && rm -rf /var/cache/pkg/* /var/db/pkg/repos/*
RUN fetch -qo /tmp/pgaudit.tar.gz \
"https://github.com/pgaudit/pgaudit/archive/refs/tags/${PGAUDIT_VERSION}.tar.gz" && \
tar -xzf /tmp/pgaudit.tar.gz -C /tmp && \
cd /tmp/pgaudit-${PGAUDIT_VERSION} && \
gmake USE_PGXS=1 install && \
rm -rf /tmp/pgaudit*
# Builder: pg_failover_slots from source
FROM ghcr.io/daemonless/postgres:${PG_VERSION} AS builder-failover-slots
ARG PG_VERSION
ARG PG_FAILOVER_SLOTS_VERSION
RUN pkg update && pkg install -y \
FreeBSD-bmake FreeBSD-clibs-dev FreeBSD-clang FreeBSD-clang-dev FreeBSD-toolchain \
gmake pkgconf openssl && \
pkg clean -ay && rm -rf /var/cache/pkg/* /var/db/pkg/repos/*
RUN fetch -qo /tmp/pg_failover_slots.tar.gz \
"https://github.com/EnterpriseDB/pg_failover_slots/archive/refs/tags/v${PG_FAILOVER_SLOTS_VERSION}.tar.gz" && \
tar -xzf /tmp/pg_failover_slots.tar.gz -C /tmp && \
cd /tmp/pg_failover_slots-${PG_FAILOVER_SLOTS_VERSION} && \
gmake USE_PGXS=1 install && \
rm -rf /tmp/pg_failover_slots*
# Production image
FROM ghcr.io/daemonless/postgres:${PG_VERSION}
ARG PG_VERSION
ARG FREEBSD_ARCH=amd64
# --- Metadata (Injected by Generator) ---
LABEL org.opencontainers.image.title="{{ title }} ${PG_VERSION}" \
org.opencontainers.image.description="{{ description }}" \
org.opencontainers.image.source="{{ repo_url }}" \
org.opencontainers.image.url="{{ web_url }}" \
org.opencontainers.image.documentation="https://www.postgresql.org/docs/${PG_VERSION}/" \
org.opencontainers.image.licenses="PostgreSQL" \
org.opencontainers.image.vendor="daemonless" \
org.opencontainers.image.authors="daemonless" \
io.daemonless.category="{{ category }}" \
{%- if volumes %}
io.daemonless.volumes="{{ volumes | map(attribute='path') | join(',') }}" \
{%- endif %}
io.daemonless.arch="${FREEBSD_ARCH}"
COPY --from=builder-pgaudit \
/usr/local/lib/postgresql/pgaudit.so \
/usr/local/lib/postgresql/
COPY --from=builder-pgaudit \
/usr/local/share/postgresql/extension/pgaudit* \
/usr/local/share/postgresql/extension/
COPY --from=builder-failover-slots \
/usr/local/lib/postgresql/pg_failover_slots.so \
/usr/local/lib/postgresql/
# No ENTRYPOINT or CMD — CloudNativePG overrides with its instance manager