From 2a39074513f9a38bca7eaac75b3996a2492f3885 Mon Sep 17 00:00:00 2001 From: Vincent Date: Thu, 23 May 2024 15:32:57 +0200 Subject: [PATCH] Install timescale tools in image --- infra/docker/database/pg13_16.Dockerfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/infra/docker/database/pg13_16.Dockerfile b/infra/docker/database/pg13_16.Dockerfile index ce051982a2..77dbd3ca06 100644 --- a/infra/docker/database/pg13_16.Dockerfile +++ b/infra/docker/database/pg13_16.Dockerfile @@ -2,12 +2,28 @@ ARG PG_MAJOR ARG TIMESCALEDB_VERSION ARG POSTGIS_VERSION +############################ +# Build tools binaries in separate image +############################ +ARG GO_VERSION=1.18.7 +FROM golang:${GO_VERSION}-alpine AS tools + +ENV TOOLS_VERSION 0.8.1 + +RUN apk update && apk add --no-cache git gcc musl-dev \ + && go install github.com/timescale/timescaledb-tune/cmd/timescaledb-tune@latest \ + && go install github.com/timescale/timescaledb-parallel-copy/cmd/timescaledb-parallel-copy@latest + +############################ +# Now build image and copy in tools +############################ FROM postgres:"$PG_MAJOR"-bookworm ARG PG_MAJOR ARG TIMESCALEDB_VERSION ARG POSTGIS_VERSION COPY infra/docker/database/docker-entrypoint-initdb.d/* /docker-entrypoint-initdb.d/ +COPY --from=tools /go/bin/* /usr/local/bin/ RUN \ apt-get update && \