1
0
mirror of https://github.com/docker/docker-credential-helpers.git synced 2026-06-13 16:01:28 +05:30

Merge pull request #412 from thaJeztah/dockerfile_docs

Dockerfile: document build-args
This commit is contained in:
Paweł Gronowski
2026-04-17 15:41:51 +02:00
committed by GitHub
2 changed files with 27 additions and 4 deletions
+18 -2
View File
@@ -1,12 +1,28 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
# GO_VERSION sets the version of the golang base image to use.
# It must be a valid tag in the docker.io/library/golang image repository.
ARG GO_VERSION=1.25.8 ARG GO_VERSION=1.25.8
ARG DEBIAN_VERSION=bookworm
# BASE_DEBIAN_DISTRO sets the golang base image debian variant to use.
# It must be a valid variant in the docker.io/library/golang image repository.
ARG BASE_DEBIAN_DISTRO=bookworm
# XX_VERSION sets the version of the xx utility to use.
# It must be a valid tag in the docker.io/tonistiigi/xx image repository.
ARG XX_VERSION=1.7.0 ARG XX_VERSION=1.7.0
# OSXCROSS_VERSION sets the MacOSX cross toolchain to use.
# It must be a valid tag in the docker.io/crazymax/osxcross image repository.
ARG OSXCROSS_VERSION=11.3-r8-debian ARG OSXCROSS_VERSION=11.3-r8-debian
# GOLANGCI_LINT_VERSION sets the version of the golangci-lint image to use.
# It must be a valid tag in the docker.io/golangci/golangci-lint image repository.
ARG GOLANGCI_LINT_VERSION=v2.8 ARG GOLANGCI_LINT_VERSION=v2.8
# PACKAGE sets the package name to print in the "--version" output.
# It sets the "github.com/docker/docker-credential-helpers/credentials.Package
# variable at compile time.
ARG PACKAGE=github.com/docker/docker-credential-helpers ARG PACKAGE=github.com/docker/docker-credential-helpers
# xx is a helper for cross-compilation # xx is a helper for cross-compilation
@@ -15,7 +31,7 @@ FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
# osxcross contains the MacOSX cross toolchain for xx # osxcross contains the MacOSX cross toolchain for xx
FROM crazymax/osxcross:${OSXCROSS_VERSION} AS osxcross FROM crazymax/osxcross:${OSXCROSS_VERSION} AS osxcross
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-${DEBIAN_VERSION} AS gobase FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO} AS gobase
COPY --from=xx / / COPY --from=xx / /
RUN apt-get update && apt-get install -y --no-install-recommends clang dpkg-dev file git lld llvm make pkg-config rsync RUN apt-get update && apt-get install -y --no-install-recommends clang dpkg-dev file git lld llvm make pkg-config rsync
ENV GOFLAGS="-mod=vendor" ENV GOFLAGS="-mod=vendor"
+9 -2
View File
@@ -1,10 +1,17 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
# GO_VERSION sets the version of the golang base image to use.
# It must be a valid tag in the docker.io/library/golang image repository.
ARG GO_VERSION=1.25.8 ARG GO_VERSION=1.25.8
# BASE_DEBIAN_DISTRO sets the golang base image debian variant to use.
# It must be a valid variant in the docker.io/library/golang image repository.
ARG BASE_DEBIAN_DISTRO=bookworm
ARG DISTRO=ubuntu ARG DISTRO=ubuntu
ARG SUITE=jammy ARG SUITE=jammy
FROM golang:${GO_VERSION}-bookworm AS golang FROM golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO} AS gobase
FROM ${DISTRO}:${SUITE} FROM ${DISTRO}:${SUITE}
RUN apt-get update && apt-get install -yy debhelper dh-make libsecret-1-dev 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
ENV GO111MODULE=off ENV GO111MODULE=off
ENV GOPATH=/build ENV GOPATH=/build
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
COPY --from=golang /usr/local/go /usr/local/go COPY --from=gobase /usr/local/go /usr/local/go
COPY Makefile . COPY Makefile .
COPY credentials credentials COPY credentials credentials