diff --git a/Dockerfile b/Dockerfile index c6d9bf8429a5..5fa0999bea5e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ ARG RUNC_VERSION=v1.1.14 ARG CONTAINERD_VERSION=v1.7.22 -# containerd v1.6 for integration tests +# CONTAINERD_ALT_VERSION_16 defines fallback containerd version for integration tests ARG CONTAINERD_ALT_VERSION_16=v1.6.36 ARG REGISTRY_VERSION=v2.8.3 ARG ROOTLESSKIT_VERSION=v2.0.2 @@ -29,22 +29,22 @@ FROM minio/mc:${MINIO_MC_VERSION} AS minio-mc # xx is a helper for cross-compilation FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx -# go base image +# golatest is alias for Go base image FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS golatest -# gobuild is base stage for compiling go/cgo +# gobuild-base is base stage for compiling go/cgo FROM golatest AS gobuild-base RUN apk add --no-cache file bash clang lld musl-dev pkgconfig git make COPY --link --from=xx / / -# delve for debug variant +# dlv builds delve for debug variant images FROM gobuild-base AS dlv ARG DELVE_VERSION RUN --mount=target=/root/.cache,type=cache \ --mount=target=/go/pkg/mod,type=cache \ GOBIN=/usr/bin go install github.com/go-delve/delve/cmd/dlv@${DELVE_VERSION} -# build runc binary +# runc builds runc binary FROM gobuild-base AS runc WORKDIR $GOPATH/src/github.com/opencontainers/runc ARG RUNC_VERSION @@ -65,7 +65,7 @@ FROM gobuild-base AS buildkit-base WORKDIR /src ENV GOFLAGS=-mod=vendor -# scan the version/revision info +# buildkit-version builds stage with version/revision info FROM buildkit-base AS buildkit-version # TODO: PKG should be inferred from go modules RUN --mount=target=. <<'EOT' @@ -79,7 +79,7 @@ RUN --mount=target=. <<'EOT' echo -n "${VERSION}" > /tmp/.version; EOT -# build buildctl binary +# buildctl builds test cli binary FROM buildkit-base AS buildctl ENV CGO_ENABLED=0 ARG TARGETPLATFORM @@ -93,7 +93,7 @@ RUN --mount=target=. --mount=target=/root/.cache,type=cache \ if [ "$(xx-info os)" = "linux" ]; then /usr/bin/buildctl --version; fi EOT -# build buildkitd binary +# buildkitd builds daemon binary FROM buildkit-base AS buildkitd # BUILDKITD_TAGS defines additional Go build tags for compiling buildkitd ARG BUILDKITD_TAGS @@ -135,7 +135,7 @@ RUN --mount=target=. --mount=target=/root/.cache,type=cache \ fi EOT -# build dnsname CNI plugin for testing +# dnsname builds dnsname CNI plugin for testing FROM gobuild-base AS dnsname WORKDIR /go/src/github.com/containers/dnsname ARG DNSNAME_VERSION @@ -186,7 +186,7 @@ COPY --link --from=buildkitd /usr/bin/buildkitd / COPY --link --from=buildctl /usr/bin/buildctl / FROM binaries-$TARGETOS AS binaries -# enable scanning for this stage +# BUILDKIT_SBOM_SCAN_STAGE enables SBOM scanning for this stage ARG BUILDKIT_SBOM_SCAN_STAGE=true FROM --platform=$BUILDPLATFORM alpine:${ALPINE_VERSION} AS releaser @@ -230,7 +230,7 @@ RUN --mount=target=/root/.cache,type=cache <