mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-13 16:01:28 +05:30
Dockerfile: document build-args
``` docker buildx build --quiet --call=outline . BUILD ARG VALUE DESCRIPTION GO_VERSION 1.25.8 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>
This commit is contained in:
+18
-2
@@ -1,12 +1,28 @@
|
||||
# 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 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
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
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 / /
|
||||
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"
|
||||
|
||||
+9
-2
@@ -1,10 +1,17 @@
|
||||
# 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
|
||||
|
||||
# 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 SUITE=jammy
|
||||
|
||||
FROM golang:${GO_VERSION}-bookworm AS golang
|
||||
FROM golang:${GO_VERSION}-${BASE_DEBIAN_DISTRO} AS gobase
|
||||
|
||||
FROM ${DISTRO}:${SUITE}
|
||||
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 GOPATH=/build
|
||||
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 credentials credentials
|
||||
|
||||
Reference in New Issue
Block a user