Skip to content

Commit 68fd60f

Browse files
author
Paulo Gomes
committed
Migrate to debian:bookworm-slim
This aligns with the final image used by source controller. Signed-off-by: Paulo Gomes <[email protected]>
1 parent 6aaf01a commit 68fd60f

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

.github/actions/run-tests/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG GO_VERSION=1.17
33
ARG XX_VERSION=1.1.0
44

55
ARG LIBGIT2_IMG=ghcr.io/fluxcd/golang-with-libgit2
6-
ARG LIBGIT2_TAG=libgit2-1.1.1-1
6+
ARG LIBGIT2_TAG=libgit2-1.1.1-3
77

88
FROM tonistiigi/xx:${XX_VERSION} AS xx
99
FROM ${LIBGIT2_IMG}:${LIBGIT2_TAG} as libgit2

Dockerfile

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ ARG GO_VERSION=1.17
33
ARG XX_VERSION=1.1.0
44

55
ARG LIBGIT2_IMG=ghcr.io/fluxcd/golang-with-libgit2
6-
ARG LIBGIT2_TAG=libgit2-1.1.1-1
6+
ARG LIBGIT2_TAG=libgit2-1.1.1-3
77

88
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
99
FROM ${LIBGIT2_IMG}:${LIBGIT2_TAG} as libgit2
@@ -14,7 +14,7 @@ FROM gostable AS go-linux
1414

1515
FROM go-${TARGETOS} AS build-base-bullseye
1616

17-
# Copy the build utiltiies
17+
# Copy the build utilities
1818
COPY --from=xx / /
1919
COPY --from=libgit2 /Makefile /libgit2/
2020

@@ -30,7 +30,7 @@ FROM build-base-${BASE_VARIANT} as libgit2-bullseye
3030
ARG TARGETPLATFORM
3131
RUN FLAGS=$(xx-clang --print-cmake-defines) make -C /libgit2 libgit2
3232

33-
FROM libgit2-${BASE_VARIANT} as build-bullseye
33+
FROM libgit2-${BASE_VARIANT} as build
3434

3535
# Configure workspace
3636
WORKDIR /workspace
@@ -58,33 +58,31 @@ ARG TARGETPLATFORM
5858
RUN xx-go build -o image-automation-controller -trimpath \
5959
main.go
6060

61-
FROM build-${BASE_VARIANT} as prepare-bullseye
61+
FROM build as prepare-bullseye
6262

6363
# Move libgit2 lib to generic and predictable location
6464
ARG TARGETPLATFORM
6565
RUN mkdir -p /libgit2/lib/ \
6666
&& cp -d /usr/lib/$(xx-info triple)/libgit2.so* /libgit2/lib/
6767

68-
FROM prepare-${BASE_VARIANT} as build
68+
FROM prepare-${BASE_VARIANT} as prepare
6969

70-
FROM debian:${BASE_VARIANT}-slim as controller
70+
# The target image must aligned with apt sources used for libgit2.
71+
FROM debian:bookworm-slim as controller
7172

7273
# Copy libgit2
73-
COPY --from=build /libgit2/lib/ /usr/local/lib/
74+
COPY --from=prepare /libgit2/lib/ /usr/local/lib/
7475
RUN ldconfig
7576

7677
# Upgrade packages and install runtime dependencies
77-
RUN echo "deb http://deb.debian.org/debian sid main" >> /etc/apt/sources.list \
78-
&& echo "deb-src http://deb.debian.org/debian sid main" >> /etc/apt/sources.list \
79-
&& apt update \
80-
&& apt install --no-install-recommends -y zlib1g/sid libssl1.1/sid libssh2-1/sid \
81-
&& apt install --no-install-recommends -y ca-certificates \
78+
RUN apt update \
79+
&& apt install -y zlib1g libssl1.1 libssh2-1 ca-certificates \
8280
&& apt clean \
8381
&& apt autoremove --purge -y \
8482
&& rm -rf /var/lib/apt/lists/*
8583

8684
# Copy over binary from build
87-
COPY --from=build /workspace/image-automation-controller /usr/local/bin/
85+
COPY --from=prepare /workspace/image-automation-controller /usr/local/bin/
8886

8987
USER 65534:65534
9088

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ CRD_OPTIONS ?= crd:crdVersions=v1
88

99
# Base image used to build the Go binary
1010
LIBGIT2_IMG ?= ghcr.io/fluxcd/golang-with-libgit2
11-
LIBGIT2_TAG ?= libgit2-1.1.1-1
11+
LIBGIT2_TAG ?= libgit2-1.1.1-3
1212

1313
# Allows for defining additional Docker buildx arguments,
1414
# e.g. '--push'.

0 commit comments

Comments
 (0)