# syntax=docker/dockerfile:1 ARG GO_VERSION=1.21 ARG XX_VERSION=1.4.0 # for testing ARG DOCKER_VERSION=26.0.0 ARG GOTESTSUM_VERSION=v1.9.0 ARG REGISTRY_VERSION=2.8.0 ARG BUILDKIT_VERSION=v0.13.1 ARG UNDOCK_VERSION=0.7.0 FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine AS golatest FROM moby/moby-bin:$DOCKER_VERSION AS docker-engine FROM dockereng/cli-bin:$DOCKER_VERSION AS docker-cli FROM registry:$REGISTRY_VERSION AS registry FROM moby/buildkit:$BUILDKIT_VERSION AS buildkit FROM crazymax/undock:$UNDOCK_VERSION AS undock FROM golatest AS gobase COPY --from=xx / / RUN apk add --no-cache file git ENV GOFLAGS=-mod=vendor ENV CGO_ENABLED=0 WORKDIR /src FROM gobase AS gotestsum ARG GOTESTSUM_VERSION ENV GOFLAGS= RUN --mount=target=/root/.cache,type=cache \ GOBIN=/out/ go install "gotest.tools/gotestsum@${GOTESTSUM_VERSION}" && \ /out/gotestsum --version FROM gobase AS buildx-version RUN --mount=type=bind,target=. <