@@ -4,12 +4,12 @@ ARG TS_VERSION
44# ###########################
55# Build tools binaries in separate image
66# ###########################
7- ARG GO_VERSION=1.19.1
7+ ARG GO_VERSION=1.23
88FROM golang:${GO_VERSION}-alpine AS tools
99
1010ENV TOOLS_VERSION 0.8.1
1111
12- RUN apk update && apk add --no-cache git gcc \
12+ RUN apk update && apk add --no-cache git gcc musl-dev \
1313 && go install github.com/timescale/timescaledb-tune/cmd/timescaledb-tune@latest \
1414 && go install github.com/timescale/timescaledb-parallel-copy/cmd/timescaledb-parallel-copy@latest
1515
@@ -426,7 +426,29 @@ RUN set -ex \
426426 && apt-get clean -y \
427427 && rm /tmp/pg_partman.tar.gz \
428428 && rm -rf /tmp/pg_partman
429-
429+
430+ ENV RUSTFLAGS="-C target-feature=-crt-static"
431+ ARG PG_BESTMATCH_RS_SHA
432+ ARG PG_VERSION
433+ RUN apt-get update -y -qq \
434+ && apt-get install -y curl gnupg openssl pkg-config libssl-dev git \
435+ && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
436+ && export PATH="/.cargo/bin:$PATH" \
437+ && export PGRX_HOME="/.pgrx/" \
438+ && mkdir -p $PGRX_HOME \
439+ && cargo install cargo-pgrx --version 0.9.3 \
440+ && rustup update stable \
441+ && cd /tmp && git clone --branch main https://github.com/tensorchord/pg_bestmatch.git \
442+ && cd pg_bestmatch \
443+ && git checkout ${PG_BESTMATCH_RS_SHA} \
444+ && export PATH="$HOME/.cargo/bin:$PATH" \
445+ && cargo install --locked cargo-pgrx --version 0.12.0-alpha.1 \
446+ && cargo pgrx init --pg${PG_VERSION}=$(which pg_config) \
447+ && cargo pgrx install --release \
448+ && cd .. \
449+ && rm -rf ./pg_bestmatch \
450+ && apt-get clean -y
451+
430452USER 1001
431453
432454ENTRYPOINT [ "/opt/bitnami/scripts/postgresql/timescaledb-bitnami-entrypoint.sh" ]
0 commit comments