Skip to content

Commit fd4ce46

Browse files
committed
distroless-iptables: provide debian 12 bookworm variant
Signed-off-by: Sascha Grunert <[email protected]>
1 parent 56ea604 commit fd4ce46

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

dependencies.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,10 @@ dependencies:
483483
match: IMAGE_VERSION\ \?=\ v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)
484484

485485
- name: "registry.k8s.io/build-image/go-runner: dependents"
486-
version: v2.3.1-go1.20.7-bullseye.0
486+
version: v2.3.1-go1.21.0-bookworm.0
487487
refPaths:
488488
- path: images/build/distroless-iptables/Makefile
489-
match: GORUNNER_VERSION \?= v\d+\.\d+\.\d+-go\d+.\d+(alpha|beta|rc)?\.?(\d+)?-bullseye\.\d+
489+
match: GORUNNER_VERSION \?= v\d+\.\d+\.\d+-go\d+.\d+(alpha|beta|rc)?\.?(\d+)?-bookworm\.\d+
490490

491491
- name: "registry.k8s.io/build-image/setcap"
492492
version: bookworm-v1.0.0

images/build/distroless-iptables/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ IMAGE=$(REGISTRY)/distroless-iptables
2020
TAG ?= $(shell git describe --tags --always --dirty)
2121
IMAGE_VERSION ?= v0.2.7
2222
CONFIG ?= distroless
23-
BASEIMAGE ?= debian:bullseye-slim
24-
GORUNNER_VERSION ?= v2.3.1-go1.20.7-bullseye.0
23+
BASEIMAGE ?= debian:bookworm-slim
24+
GORUNNER_VERSION ?= v2.3.1-go1.21.0-bookworm.0
2525

2626
ARCH?=amd64
2727
ALL_ARCH = amd64 arm arm64 ppc64le s390x

images/build/distroless-iptables/distroless/package-utils.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ file_to_package() {
1919
# `dpkg-query --search $file-pattern` outputs lines with the format: "$package: $file-path"
2020
# where $file-path belongs to $package
2121
# https://manpages.debian.org/jessie/dpkg/dpkg-query.1.en.html
22-
dpkg-query --search "$(realpath "${1}")" | cut -d':' -f1
22+
(dpkg-query --search "$(realpath "${1}")" || true) | cut -d':' -f1
2323
}
2424

2525
# package_to_copyright gives the path to the copyright file for the package $1
@@ -37,10 +37,13 @@ stage_file() {
3737
fi
3838
# get the package so we can stage package metadata as well
3939
package="$(file_to_package "${1}")"
40-
# stage the copyright for the file
41-
cp -a --parents "$(package_to_copyright "${package}")" "${2}"
42-
# stage the package status mimicking bazel
43-
# https://github.com/bazelbuild/rules_docker/commit/f5432b813e0a11491cf2bf83ff1a923706b36420
44-
# instead of parsing the control file, we can just get the actual package status with dpkg
45-
dpkg -s "${package}" > "${2}/var/lib/dpkg/status.d/${package}"
40+
41+
if [[ "$package" != "" ]]; then
42+
# stage the copyright for the file
43+
cp -a --parents "$(package_to_copyright "${package}")" "${2}"
44+
# stage the package status mimicking bazel
45+
# https://github.com/bazelbuild/rules_docker/commit/f5432b813e0a11491cf2bf83ff1a923706b36420
46+
# instead of parsing the control file, we can just get the actual package status with dpkg
47+
dpkg -s "${package}" > "${2}/var/lib/dpkg/status.d/${package}"
48+
fi
4649
}

images/build/distroless-iptables/variants.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ variants:
22
distroless:
33
CONFIG: 'distroless'
44
IMAGE_VERSION: 'v0.2.7'
5-
GORUNNER_VERSION: 'v2.3.1-go1.20.6-bullseye.0'
5+
GORUNNER_VERSION: 'v2.3.1-go1.21.0-bookworm.0'

0 commit comments

Comments
 (0)