Skip to content

Commit 5975365

Browse files
committed
Dockerfile: document build-args
``` docker buildx build --quiet --call=outline . BUILD ARG VALUE DESCRIPTION GO_VERSION 1.25.7 sets the version of the golang base image to use. BASE_DEBIAN_DISTRO bookworm sets the golang base image debian variant to use. XX_VERSION 1.7.0 sets the version of the xx utility to use. OSXCROSS_VERSION 11.3-r8-debian sets the MacOSX cross toolchain to use. PACKAGE github.com/docker/docker-credential-helpers sets the package name to print in the "--version" output. ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 4e2b0ff commit 5975365

2 files changed

Lines changed: 27 additions & 4 deletions

File tree

Dockerfile

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
# syntax=docker/dockerfile:1
22

3+
# GO_VERSION sets the version of the golang base image to use.
4+
# It must be a valid tag in the docker.io/library/golang image repository.
35
ARG GO_VERSION=1.25.7
4-
ARG DEBIAN_VERSION=bookworm
56

7+
# BASE_DEBIAN_DISTRO sets the golang base image debian variant to use.
8+
# It must be a valid variant in the docker.io/library/golang image repository.
9+
ARG BASE_DEBIAN_DISTRO=bookworm
10+
11+
# XX_VERSION sets the version of the xx utility to use.
12+
# It must be a valid tag in the docker.io/tonistiigi/xx image repository.
613
ARG XX_VERSION=1.7.0
14+
15+
# OSXCROSS_VERSION sets the MacOSX cross toolchain to use.
16+
# It must be a valid tag in the docker.io/crazymax/osxcross image repository.
717
ARG OSXCROSS_VERSION=11.3-r8-debian
18+
19+
# GOLANGCI_LINT_VERSION sets the version of the golangci-lint image to use.
20+
# It must be a valid tag in the docker.io/golangci/golangci-lint image repository.
821
ARG GOLANGCI_LINT_VERSION=v2.8
922

23+
# PACKAGE sets the package name to print in the "--version" output.
24+
# It sets the "github.com/docker/docker-credential-helpers/credentials.Package
25+
# variable at compile time.
1026
ARG PACKAGE=github.com/docker/docker-credential-helpers
1127

1228
# xx is a helper for cross-compilation
@@ -15,7 +31,7 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
1531
# osxcross contains the MacOSX cross toolchain for xx
1632
FROM crazymax/osxcross:${OSXCROSS_VERSION} AS osxcross
1733

18-
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-${DEBIAN_VERSION} AS gobase
34+
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO} AS gobase
1935
COPY --from=xx / /
2036
RUN apt-get update && apt-get install -y --no-install-recommends clang dpkg-dev file git lld llvm make pkg-config rsync
2137
ENV GOFLAGS="-mod=vendor"

deb/Dockerfile

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

3+
# GO_VERSION sets the version of the golang base image to use.
4+
# It must be a valid tag in the docker.io/library/golang image repository.
35
ARG GO_VERSION=1.25.7
6+
7+
# BASE_DEBIAN_DISTRO sets the golang base image debian variant to use.
8+
# It must be a valid variant in the docker.io/library/golang image repository.
9+
ARG BASE_DEBIAN_DISTRO=bookworm
10+
411
ARG DISTRO=ubuntu
512
ARG SUITE=jammy
613

7-
FROM golang:${GO_VERSION}-bookworm AS golang
14+
FROM golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO} AS gobase
815

916
FROM ${DISTRO}:${SUITE}
1017
RUN apt-get update && apt-get install -yy debhelper dh-make libsecret-1-dev
@@ -15,7 +22,7 @@ ENV GOPROXY=https://proxy.golang.org|direct
1522
ENV GO111MODULE=off
1623
ENV GOPATH=/build
1724
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
18-
COPY --from=golang /usr/local/go /usr/local/go
25+
COPY --from=gobase /usr/local/go /usr/local/go
1926

2027
COPY Makefile .
2128
COPY credentials credentials

0 commit comments

Comments
 (0)