Repository navigation
Expand file tree
/
Copy pathDockerfile.benchmark-trixie
More file actions
98 lines (93 loc) · 3.64 KB
/
Copy pathDockerfile.benchmark-trixie
File metadata and controls
98 lines (93 loc) · 3.64 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# syntax=docker/dockerfile:1.7
# Minimal image for pg_eviltransform benchmark on Debian trixie.
ARG BASE_IMAGE=postgres:19.0-trixie
FROM ${BASE_IMAGE}
ARG DEBIAN_FRONTEND=noninteractive
# Keep the build argument distinct from the base image's PG_MAJOR environment.
ARG TARGET_PG_MAJOR=19
ARG CARGO_PGRX_VERSION=0.20.1
ARG RUST_TOOLCHAIN=1.99.1
ARG DEBIAN_MIRROR=
ARG DEBIAN_SECURITY_MIRROR=
ARG PGDG_MIRROR=
ARG RUSTUP_DIST_SERVER=
ARG RUSTUP_UPDATE_ROOT=
ARG CARGO_REGISTRIES_CRATES_IO_INDEX=
ENV PATH=/usr/lib/postgresql/${TARGET_PG_MAJOR}/bin:/root/.cargo/bin:$PATH \
PG_MAJOR=${TARGET_PG_MAJOR} \
PGDATA=/var/lib/postgresql/${TARGET_PG_MAJOR}/docker \
CC=clang \
AR=llvm-ar \
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN set -eux; \
sed -i 's|http://apt.postgresql.org|https://apt.postgresql.org|g' /etc/apt/sources.list.d/pgdg.list; \
if [ -n "$DEBIAN_MIRROR" ]; then \
find /etc/apt -type f \( -name '*.list' -o -name '*.sources' \) -exec \
sed -i \
-e "s|http://deb.debian.org/debian|$DEBIAN_MIRROR|g" \
-e "s|https://deb.debian.org/debian|$DEBIAN_MIRROR|g" \
{} +; \
fi; \
if [ -n "$DEBIAN_SECURITY_MIRROR" ]; then \
find /etc/apt -type f \( -name '*.list' -o -name '*.sources' \) -exec \
sed -i \
-e "s|http://deb.debian.org/debian-security|$DEBIAN_SECURITY_MIRROR|g" \
-e "s|https://deb.debian.org/debian-security|$DEBIAN_SECURITY_MIRROR|g" \
{} +; \
fi; \
if [ -n "$PGDG_MIRROR" ]; then \
find /etc/apt -type f \( -name '*.list' -o -name '*.sources' \) -exec \
sed -i \
-e "s|http://apt.postgresql.org/pub/repos/apt|$PGDG_MIRROR|g" \
-e "s|https://apt.postgresql.org/pub/repos/apt|$PGDG_MIRROR|g" \
{} +; \
fi; \
# Bootstrap the trust store from Debian before contacting PGDG over HTTPS.
mv /etc/apt/sources.list.d/pgdg.list /tmp/pgdg.list; \
apt-get update -o APT::Update::Error-Mode=any; \
apt-get install -y --no-install-recommends ca-certificates; \
mv /tmp/pgdg.list /etc/apt/sources.list.d/pgdg.list; \
apt-get update -o APT::Update::Error-Mode=any; \
apt-get install -y --no-install-recommends \
curl \
sudo \
pkg-config \
clang \
libclang-dev \
llvm \
llvm-dev \
libc6-dev \
libicu-dev \
libgeos-dev \
librttopo-dev \
postgresql-${PG_MAJOR} \
postgresql-server-dev-${PG_MAJOR}; \
apt-get install -y --no-install-recommends \
postgresql-${PG_MAJOR}-postgis-3 \
postgresql-${PG_MAJOR}-postgis-3-scripts; \
update-ca-certificates; \
rm -rf /var/lib/apt/lists/* /tmp/*
RUN --mount=type=cache,target=/root/.cargo/registry \
--mount=type=cache,target=/root/.cargo/git \
--mount=type=cache,target=/root/.rustup/downloads \
set -eux; \
if [ -n "$RUSTUP_DIST_SERVER" ]; then export RUSTUP_DIST_SERVER; fi; \
if [ -n "$RUSTUP_UPDATE_ROOT" ]; then export RUSTUP_UPDATE_ROOT; fi; \
if [ -n "$CARGO_REGISTRIES_CRATES_IO_INDEX" ]; then export CARGO_REGISTRIES_CRATES_IO_INDEX; fi; \
rustup_arch="$(uname -m)"; \
case "$rustup_arch" in \
x86_64) rustup_triple="x86_64-unknown-linux-gnu" ;; \
aarch64|arm64) rustup_triple="aarch64-unknown-linux-gnu" ;; \
*) echo "unsupported rustup architecture: $rustup_arch" >&2; exit 1 ;; \
esac; \
if [ -n "$RUSTUP_UPDATE_ROOT" ]; then \
curl -sSfL "$RUSTUP_UPDATE_ROOT/dist/$rustup_triple/rustup-init" -o /tmp/rustup-init; \
chmod +x /tmp/rustup-init; \
/tmp/rustup-init -y --profile minimal; \
else \
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal; \
fi; \
rustup default "$RUST_TOOLCHAIN"; \
cargo install --locked cargo-pgrx --version "$CARGO_PGRX_VERSION"
WORKDIR /work
COPY . /work