mirror of https://github.com/docker/cli.git
Dockerfile: use "debian" in stages instead of distro name
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
c5194a9e5d
commit
0d95231ccb
|
@ -26,7 +26,7 @@ jobs:
|
||||||
- connhelper-ssh
|
- connhelper-ssh
|
||||||
base:
|
base:
|
||||||
- alpine
|
- alpine
|
||||||
- bookworm
|
- debian
|
||||||
engine-version:
|
engine-version:
|
||||||
# - 20.10-dind # FIXME: Fails on 20.10
|
# - 20.10-dind # FIXME: Fails on 20.10
|
||||||
- stable-dind # TODO: Use 20.10-dind, stable-dind is deprecated
|
- stable-dind # TODO: Use 20.10-dind, stable-dind is deprecated
|
||||||
|
|
10
Dockerfile
10
Dockerfile
|
@ -1,8 +1,10 @@
|
||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG BASE_VARIANT=alpine
|
ARG BASE_VARIANT=alpine
|
||||||
ARG GO_VERSION=1.21.3
|
|
||||||
ARG ALPINE_VERSION=3.17
|
ARG ALPINE_VERSION=3.17
|
||||||
|
ARG BASE_DEBIAN_DISTRO=bookworm
|
||||||
|
|
||||||
|
ARG GO_VERSION=1.21.3
|
||||||
ARG XX_VERSION=1.2.1
|
ARG XX_VERSION=1.2.1
|
||||||
ARG GOVERSIONINFO_VERSION=v1.3.0
|
ARG GOVERSIONINFO_VERSION=v1.3.0
|
||||||
ARG GOTESTSUM_VERSION=v1.10.0
|
ARG GOTESTSUM_VERSION=v1.10.0
|
||||||
|
@ -22,13 +24,13 @@ ARG TARGETPLATFORM
|
||||||
# gcc is installed for libgcc only
|
# gcc is installed for libgcc only
|
||||||
RUN xx-apk add --no-cache musl-dev gcc
|
RUN xx-apk add --no-cache musl-dev gcc
|
||||||
|
|
||||||
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bookworm AS build-base-bookworm
|
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO} AS build-base-debian
|
||||||
ENV GOTOOLCHAIN=local
|
ENV GOTOOLCHAIN=local
|
||||||
COPY --link --from=xx / /
|
COPY --link --from=xx / /
|
||||||
RUN apt-get update && apt-get install --no-install-recommends -y bash clang lld llvm file
|
RUN apt-get update && apt-get install --no-install-recommends -y bash clang lld llvm file
|
||||||
WORKDIR /go/src/github.com/docker/cli
|
WORKDIR /go/src/github.com/docker/cli
|
||||||
|
|
||||||
FROM build-base-bookworm AS build-bookworm
|
FROM build-base-debian AS build-debian
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
RUN xx-apt-get install --no-install-recommends -y libc6-dev libgcc-12-dev pkgconf
|
RUN xx-apt-get install --no-install-recommends -y libc6-dev libgcc-12-dev pkgconf
|
||||||
|
|
||||||
|
@ -94,7 +96,7 @@ RUN --mount=ro --mount=type=cache,target=/root/.cache \
|
||||||
FROM build-base-alpine AS e2e-base-alpine
|
FROM build-base-alpine AS e2e-base-alpine
|
||||||
RUN apk add --no-cache build-base curl openssl openssh-client
|
RUN apk add --no-cache build-base curl openssl openssh-client
|
||||||
|
|
||||||
FROM build-base-bookworm AS e2e-base-bookworm
|
FROM build-base-debian AS e2e-base-debian
|
||||||
RUN apt-get update && apt-get install -y build-essential curl openssl openssh-client
|
RUN apt-get update && apt-get install -y build-essential curl openssl openssh-client
|
||||||
|
|
||||||
FROM docker/buildx-bin:${BUILDX_VERSION} AS buildx
|
FROM docker/buildx-bin:${BUILDX_VERSION} AS buildx
|
||||||
|
|
|
@ -52,7 +52,7 @@ target "binary" {
|
||||||
platforms = ["local"]
|
platforms = ["local"]
|
||||||
output = ["build"]
|
output = ["build"]
|
||||||
args = {
|
args = {
|
||||||
BASE_VARIANT = USE_GLIBC == "1" ? "bookworm" : "alpine"
|
BASE_VARIANT = USE_GLIBC == "1" ? "debian" : "alpine"
|
||||||
VERSION = VERSION
|
VERSION = VERSION
|
||||||
PACKAGER_NAME = PACKAGER_NAME
|
PACKAGER_NAME = PACKAGER_NAME
|
||||||
GO_STRIP = STRIP_TARGET
|
GO_STRIP = STRIP_TARGET
|
||||||
|
@ -72,7 +72,7 @@ target "plugins" {
|
||||||
platforms = ["local"]
|
platforms = ["local"]
|
||||||
output = ["build"]
|
output = ["build"]
|
||||||
args = {
|
args = {
|
||||||
BASE_VARIANT = USE_GLIBC == "1" ? "bookworm" : "alpine"
|
BASE_VARIANT = USE_GLIBC == "1" ? "debian" : "alpine"
|
||||||
VERSION = VERSION
|
VERSION = VERSION
|
||||||
GO_STRIP = STRIP_TARGET
|
GO_STRIP = STRIP_TARGET
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ target "e2e-image" {
|
||||||
output = ["type=docker"]
|
output = ["type=docker"]
|
||||||
tags = ["${IMAGE_NAME}"]
|
tags = ["${IMAGE_NAME}"]
|
||||||
args = {
|
args = {
|
||||||
BASE_VARIANT = USE_GLIBC == "1" ? "bookworm" : "alpine"
|
BASE_VARIANT = USE_GLIBC == "1" ? "debian" : "alpine"
|
||||||
VERSION = VERSION
|
VERSION = VERSION
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue