Skip to content

Commit a203e93

Browse files
committed
Change baseimage to trixie
1 parent 239a784 commit a203e93

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

Dockerfile.in

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ RUN apt-get -y -qq -o Dpkg::Use-Pty=0 update
5151
RUN apt-get -y -qq -o Dpkg::Use-Pty=0 -y upgrade
5252

5353
RUN apt-get -y -qq -o Dpkg::Use-Pty=0 install --no-install-recommends bash # for the staging scripts and ldd
54+
# Newer Debian uses symlinks but the stage_binaries tool is kind of dumb.
5455
RUN mkdir -p {ARG_STAGING}
56+
RUN mkdir -p {ARG_STAGING}/usr/bin && ln -s usr/bin {ARG_STAGING}/bin
57+
RUN mkdir -p {ARG_STAGING}/usr/sbin && ln -s usr/sbin {ARG_STAGING}/sbin
58+
RUN mkdir -p {ARG_STAGING}/usr/lib && ln -s usr/lib {ARG_STAGING}/lib
59+
RUN mkdir -p {ARG_STAGING}/usr/lib64 && ln -s usr/lib64 {ARG_STAGING}/lib64
5560
COPY stage_binaries.sh /
5661
RUN /stage_binaries.sh -o {ARG_STAGING} \
5762
-p base-files \
@@ -70,14 +75,14 @@ RUN /stage_binaries.sh -o {ARG_STAGING} \
7075
-f /etc/os-release \
7176
-f /etc/passwd \
7277
-f /tmp
73-
RUN ln -s /bin/bash {ARG_STAGING}/bin/sh # Not sure why this is not set up automatically
78+
RUN ln -s bash {ARG_STAGING}/bin/sh # Not sure why this is not set up automatically
7479

7580
FROM scratch AS intermediate
7681

7782
# Docker doesn't do vars in COPY, so we can't use a regular ARG.
7883
COPY --from=base {ARG_STAGING} /
7984

80-
# This list is not generic - it is specific to git-sync on debian bookworm.
85+
# This list is not generic - it is specific to git-sync on debian trixie.
8186
RUN rm -rf \
8287
/usr/share/base-files \
8388
/usr/share/doc \
@@ -103,7 +108,8 @@ RUN rm -rf \
103108
/usr/lib/openssh/ssh-keysign \
104109
/usr/lib/openssh/ssh-pkcs11-helper \
105110
/usr/lib/openssh/ssh-sk-helper \
106-
/usr/share/gitweb
111+
/usr/share/gitweb \
112+
/usr/share/locale
107113

108114
# Add the default UID to /etc/passwd so SSH is satisfied.
109115
RUN echo "git-sync:x:65533:65533::/tmp:/sbin/nologin" >> /etc/passwd

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ ALL_PLATFORMS := linux/amd64 linux/arm linux/arm64 linux/ppc64le linux/s390x
4545
OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS))
4646
ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH))
4747

48-
BASEIMAGE ?= registry.k8s.io/build-image/debian-base:bookworm-v1.0.2
48+
BASEIMAGE ?= debian:trixie
4949

5050
IMAGE := $(REGISTRY)/$(BIN)
5151
TAG := $(VERSION)
5252
OS_ARCH_TAG := $(TAG)__$(OS)_$(ARCH)
5353

54-
BUILD_IMAGE ?= golang:1.24
54+
BUILD_IMAGE ?= golang:1.25
5555

5656
DBG_MAKEFILE ?=
5757
ifneq ($(DBG_MAKEFILE),1)

stage_binaries.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function file_to_package() {
167167
# `dpkg-query --search $file-pattern` outputs lines with the format: "$package: $file-path"
168168
# where $file-path belongs to $package. Sometimes it has lines that say
169169
# "diversion" but there's no documented grammar I can find.
170-
echo "${result}" | grep -v "diversion" | cut -d':' -f1
170+
echo "${result}" | (grep -v "diversion" || true) | cut -d':' -f1
171171
}
172172

173173
function ensure_dir_in_staging() {
@@ -216,6 +216,9 @@ function stage_file_and_deps() {
216216
# get the package so we can stage package metadata as well
217217
local package
218218
package="$(file_to_package "${file}")"
219+
if [[ -z "${package}" ]]; then
220+
return 0 # no package, but no error either
221+
fi
219222
DBG "staging file ${file} from pkg ${package}"
220223

221224
stage_one_file "${staging}" "$file"

0 commit comments

Comments
 (0)