Skip to content

Commit 1d1ae68

Browse files
committed
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 <jonathan.gonzalez@enterprisedb.com>
1 parent 75d5e0f commit 1d1ae68

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

Dockerfile.barman

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ARG BASE=debian:12.11-slim
2+
FROM $BASE AS barman
3+
4+
RUN --mount=type=secret,id=requirements,target=/run/secrets/requirements.txt \
5+
apt-get update && \
6+
apt-get install -y postgresql-common build-essential && \
7+
/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && \
8+
apt-get install -y libpq-dev && \
9+
pip install -r /run/secrets/requirements.txt

docker-bake.hcl

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ variable "revision" {
1616
}
1717

1818
fullname = ( environment == "testing") ? "${registry}/postgresql-testing" : "${registry}/postgresql"
19+
barmanFullname = ( environment == "testing") ? "${registry}/barman-testing" : "${registry}/barman"
1920
now = timestamp()
2021
authors = "The CloudNativePG Contributors"
2122
url = "https://github.com/cloudnative-pg/postgres-containers"
@@ -120,6 +121,46 @@ target "default" {
120121
}
121122
}
122123

124+
target "barman" {
125+
matrix = {
126+
pgVersion = postgreSQLVersions
127+
base = [
128+
// renovate: datasource=docker versioning=loose
129+
"debian:trixie-slim@sha256:c85a2732e97694ea77237c61304b3bb410e0e961dd6ee945997a06c788c545bb",
130+
// renovate: datasource=docker versioning=loose
131+
"debian:bookworm-slim@sha256:b1a741487078b369e78119849663d7f1a5341ef2768798f7b7406c4240f86aef",
132+
// renovate: datasource=docker versioning=loose
133+
"debian:bullseye-slim@sha256:849d9d34d5fe0bf88b5fb3d09eb9684909ac4210488b52f4f7bbe683eedcb851"
134+
]
135+
barmanVersion = [
136+
"3.14.1",
137+
"3.15.0"
138+
]
139+
}
140+
platforms = [
141+
"linux/amd64",
142+
"linux/arm64"
143+
]
144+
145+
146+
dockerfile = "Dockerfile.barman"
147+
name = "barman-${barmanVersion}-${distroVersion(base)}"
148+
tags = [
149+
"${barmanFullname}:${barmanVerison}-${distroVersion(base)}",
150+
"${barmanFullname}:${barmanVersion}-${formatdate("YYYYMMDDhhmm", now)}-${distroVersion(base)}"
151+
]
152+
context = "."
153+
target = "barman"
154+
args = {
155+
BARMAN_VERSION = "${barmanVersion}"
156+
BASE = "${base}"
157+
}
158+
attest = [
159+
"type=provenance,mode=max",
160+
"type=sbom"
161+
]
162+
}
163+
123164
function tag {
124165
params = [ imageNameWithSha ]
125166
result = index(split("@", index(split(":", imageNameWithSha), 1)), 0)

0 commit comments

Comments
 (0)