From 1d1ae682b7f0c595853c73e490731364de76559d Mon Sep 17 00:00:00 2001 From: Jonathan Gonzalez V Date: Sat, 6 Sep 2025 15:09:05 +0200 Subject: [PATCH] chore: add Barman versions in a container image Adding the Barman by version and Debian distribution into an image to later use as a provider to for the system images Closes #290 Signed-off-by: Jonathan Gonzalez V --- Dockerfile.barman | 9 +++++++++ docker-bake.hcl | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 Dockerfile.barman diff --git a/Dockerfile.barman b/Dockerfile.barman new file mode 100644 index 00000000..343ae97c --- /dev/null +++ b/Dockerfile.barman @@ -0,0 +1,9 @@ +ARG BASE=debian:12.11-slim +FROM $BASE AS barman + +RUN --mount=type=secret,id=requirements,target=/run/secrets/requirements.txt \ + 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 /run/secrets/requirements.txt diff --git a/docker-bake.hcl b/docker-bake.hcl index 83fcf751..46538155 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -16,6 +16,7 @@ variable "revision" { } fullname = ( environment == "testing") ? "${registry}/postgresql-testing" : "${registry}/postgresql" +barmanFullname = ( environment == "testing") ? "${registry}/barman-testing" : "${registry}/barman" now = timestamp() authors = "The CloudNativePG Contributors" url = "https://github.com/cloudnative-pg/postgres-containers" @@ -120,6 +121,46 @@ target "default" { } } +target "barman" { + matrix = { + pgVersion = postgreSQLVersions + base = [ + // renovate: datasource=docker versioning=loose + "debian:trixie-slim@sha256:c85a2732e97694ea77237c61304b3bb410e0e961dd6ee945997a06c788c545bb", + // renovate: datasource=docker versioning=loose + "debian:bookworm-slim@sha256:b1a741487078b369e78119849663d7f1a5341ef2768798f7b7406c4240f86aef", + // renovate: datasource=docker versioning=loose + "debian:bullseye-slim@sha256:849d9d34d5fe0bf88b5fb3d09eb9684909ac4210488b52f4f7bbe683eedcb851" + ] + barmanVersion = [ + "3.14.1", + "3.15.0" + ] + } + platforms = [ + "linux/amd64", + "linux/arm64" + ] + + + dockerfile = "Dockerfile.barman" + name = "barman-${barmanVersion}-${distroVersion(base)}" + tags = [ + "${barmanFullname}:${barmanVerison}-${distroVersion(base)}", + "${barmanFullname}:${barmanVersion}-${formatdate("YYYYMMDDhhmm", now)}-${distroVersion(base)}" + ] + context = "." + target = "barman" + args = { + BARMAN_VERSION = "${barmanVersion}" + BASE = "${base}" + } + attest = [ + "type=provenance,mode=max", + "type=sbom" + ] +} + function tag { params = [ imageNameWithSha ] result = index(split("@", index(split(":", imageNameWithSha), 1)), 0)