From 6af2314bc93c030ec9dbb8bf03884d63e712013b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Fei?= Date: Mon, 18 Aug 2025 14:17:03 +0200 Subject: [PATCH] fix: move sidecar changes to another PR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Niccolò Fei --- .github/workflows/barman-base-image.yml | 1 - Taskfile.yml | 2 +- containers/Dockerfile.sidecar | 15 +++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/barman-base-image.yml b/.github/workflows/barman-base-image.yml index d2330c6..ad16bc6 100644 --- a/.github/workflows/barman-base-image.yml +++ b/.github/workflows/barman-base-image.yml @@ -1,6 +1,5 @@ name: Barman Base Image on: - pull_request: workflow_dispatch: schedule: - cron: "0 0 * * 0" diff --git a/Taskfile.yml b/Taskfile.yml index d2c62bc..a775bc6 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -378,7 +378,7 @@ tasks: publish --ref {{.SIDECAR_IMAGE_NAME}} --tags {{.IMAGE_VERSION}} publish-barman-base: - desc: Build and publish a barman-cloud base container image (sidecar) + desc: Build and publish a barman-cloud base container image vars: BARMAN_BASE_IMAGE_NAME: ghcr.io/{{.GITHUB_REPOSITORY}}-base{{if not (hasPrefix "refs/heads/main" .GITHUB_REF)}}-testing{{end}} BARMAN_VERSION: diff --git a/containers/Dockerfile.sidecar b/containers/Dockerfile.sidecar index d5484cc..bacb5f4 100644 --- a/containers/Dockerfile.sidecar +++ b/containers/Dockerfile.sidecar @@ -33,10 +33,17 @@ COPY ../internal/ internal/ RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \ CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/manager/main.go -# Use plugin-barman-cloud-base to get the dependencies. -# pip will build everything inside /usr, so we copy every file into a new -# destination that will then be copied into the distroless container -FROM ghcr.io/cloudnative-pg/plugin-barman-cloud-base:latest AS pythonbuilder +# Build barman-cloud +# pip will build everything inside /usr/ since this is the case +# we should build and then copy every file into a destination that will +# then copy into the distroless container +FROM python:3.13-slim-bookworm AS pythonbuilder +COPY containers/sidecar-requirements.txt . +RUN apt-get update && \ + apt-get install -y postgresql-common build-essential && \ + /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && \ + apt-get install -y libpq-dev && \ + pip install -r sidecar-requirements.txt # Prepare a new /usr/ directory with the files we'll need in the final image RUN mkdir /new-usr/ && \ cp -r --parents /usr/local/lib/ /usr/lib/*-linux-gnu/ /usr/local/bin/ \