Skip to content

Commit 1c6d7d0

Browse files
authored
Merge pull request #4410 from crazy-max/update-bookworm
Dockerfile: update to debian bookworm
2 parents ce22ac2 + 0d95231 commit 1c6d7d0

3 files changed

Lines changed: 11 additions & 18 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- connhelper-ssh
2727
base:
2828
- alpine
29-
- bullseye
29+
- debian
3030
engine-version:
3131
# - 20.10-dind # FIXME: Fails on 20.10
3232
- stable-dind # TODO: Use 20.10-dind, stable-dind is deprecated

Dockerfile

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# syntax=docker/dockerfile:1
22

33
ARG BASE_VARIANT=alpine
4-
ARG GO_VERSION=1.21.3
54
ARG ALPINE_VERSION=3.17
5+
ARG BASE_DEBIAN_DISTRO=bookworm
6+
7+
ARG GO_VERSION=1.21.3
68
ARG XX_VERSION=1.2.1
79
ARG GOVERSIONINFO_VERSION=v1.3.0
810
ARG GOTESTSUM_VERSION=v1.10.0
@@ -22,22 +24,15 @@ ARG TARGETPLATFORM
2224
# gcc is installed for libgcc only
2325
RUN xx-apk add --no-cache musl-dev gcc
2426

25-
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bullseye AS build-base-bullseye
27+
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO} AS build-base-debian
2628
ENV GOTOOLCHAIN=local
2729
COPY --link --from=xx / /
2830
RUN apt-get update && apt-get install --no-install-recommends -y bash clang lld llvm file
2931
WORKDIR /go/src/github.com/docker/cli
3032

31-
FROM build-base-bullseye AS build-bullseye
33+
FROM build-base-debian AS build-debian
3234
ARG TARGETPLATFORM
33-
RUN xx-apt-get install --no-install-recommends -y libc6-dev libgcc-10-dev
34-
# workaround for issue with llvm 11 for darwin/amd64 platform:
35-
# # github.com/docker/cli/cmd/docker
36-
# /usr/local/go/pkg/tool/linux_amd64/link: /usr/local/go/pkg/tool/linux_amd64/link: running strip failed: exit status 1
37-
# llvm-strip: error: unsupported load command (cmd=0x5)
38-
# more info: https://github.com/docker/cli/pull/3717
39-
# FIXME: remove once llvm 12 available on debian
40-
RUN [ "$TARGETPLATFORM" != "darwin/amd64" ] || ln -sfnT /bin/true /usr/bin/llvm-strip
35+
RUN xx-apt-get install --no-install-recommends -y libc6-dev libgcc-12-dev pkgconf
4136

4237
FROM build-base-${BASE_VARIANT} AS goversioninfo
4338
ARG GOVERSIONINFO_VERSION
@@ -66,8 +61,6 @@ ARG VERSION
6661
# PACKAGER_NAME sets the company that produced the windows binary
6762
ARG PACKAGER_NAME
6863
COPY --link --from=goversioninfo /out/goversioninfo /usr/bin/goversioninfo
69-
# in bullseye arm64 target does not link with lld so configure it to use ld instead
70-
RUN [ ! -f /etc/alpine-release ] && xx-info is-cross && [ "$(xx-info arch)" = "arm64" ] && XX_CC_PREFER_LINKER=ld xx-clang --setup-target-triple || true
7164
RUN --mount=type=bind,target=.,ro \
7265
--mount=type=cache,target=/root/.cache \
7366
--mount=from=dockercore/golang-cross:xx-sdk-extras,target=/xx-sdk,src=/xx-sdk \
@@ -103,7 +96,7 @@ RUN --mount=ro --mount=type=cache,target=/root/.cache \
10396
FROM build-base-alpine AS e2e-base-alpine
10497
RUN apk add --no-cache build-base curl openssl openssh-client
10598

106-
FROM build-base-bullseye AS e2e-base-bullseye
99+
FROM build-base-debian AS e2e-base-debian
107100
RUN apt-get update && apt-get install -y build-essential curl openssl openssh-client
108101

109102
FROM docker/buildx-bin:${BUILDX_VERSION} AS buildx

docker-bake.hcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ target "binary" {
5252
platforms = ["local"]
5353
output = ["build"]
5454
args = {
55-
BASE_VARIANT = USE_GLIBC == "1" ? "bullseye" : "alpine"
55+
BASE_VARIANT = USE_GLIBC == "1" ? "debian" : "alpine"
5656
VERSION = VERSION
5757
PACKAGER_NAME = PACKAGER_NAME
5858
GO_STRIP = STRIP_TARGET
@@ -72,7 +72,7 @@ target "plugins" {
7272
platforms = ["local"]
7373
output = ["build"]
7474
args = {
75-
BASE_VARIANT = USE_GLIBC == "1" ? "bullseye" : "alpine"
75+
BASE_VARIANT = USE_GLIBC == "1" ? "debian" : "alpine"
7676
VERSION = VERSION
7777
GO_STRIP = STRIP_TARGET
7878
}
@@ -155,7 +155,7 @@ target "e2e-image" {
155155
output = ["type=docker"]
156156
tags = ["${IMAGE_NAME}"]
157157
args = {
158-
BASE_VARIANT = USE_GLIBC == "1" ? "bullseye" : "alpine"
158+
BASE_VARIANT = USE_GLIBC == "1" ? "debian" : "alpine"
159159
VERSION = VERSION
160160
}
161161
}

0 commit comments

Comments
 (0)