1
- # syntax=docker/dockerfile-upstream:master@sha256:df54e73548d586209f6fc6d34d61edf8277e1b9d2704aff8fe75294a17c6a29b
1
+ # syntax=docker/dockerfile-upstream:master
2
2
3
3
ARG RUNC_VERSION=v1.1.14
4
4
ARG CONTAINERD_VERSION=v1.7.22
5
- # containerd v1.6 for integration tests
5
+ # CONTAINERD_ALT_VERSION_16 defines fallback containerd version for integration tests
6
6
ARG CONTAINERD_ALT_VERSION_16=v1.6.36
7
7
ARG REGISTRY_VERSION=v2.8.3
8
8
ARG ROOTLESSKIT_VERSION=v2.0.2
@@ -29,22 +29,22 @@ FROM minio/mc:${MINIO_MC_VERSION} AS minio-mc
29
29
# xx is a helper for cross-compilation
30
30
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
31
31
32
- # go base image
32
+ # golatest is alias for Go base image
33
33
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS golatest
34
34
35
- # gobuild is base stage for compiling go/cgo
35
+ # gobuild-base is base stage for compiling go/cgo
36
36
FROM golatest AS gobuild-base
37
37
RUN apk add --no-cache file bash clang lld musl-dev pkgconfig git make
38
38
COPY --link --from=xx / /
39
39
40
- # delve for debug variant
40
+ # dlv builds delve for debug variant images
41
41
FROM gobuild-base AS dlv
42
42
ARG DELVE_VERSION
43
43
RUN --mount=target=/root/.cache,type=cache \
44
44
--mount=target=/go/pkg/mod,type=cache \
45
45
GOBIN=/usr/bin go install github.com/go-delve/delve/cmd/dlv@${DELVE_VERSION}
46
46
47
- # build runc binary
47
+ # runc builds runc binary
48
48
FROM gobuild-base AS runc
49
49
WORKDIR $GOPATH/src/github.com/opencontainers/runc
50
50
ARG RUNC_VERSION
@@ -65,7 +65,7 @@ FROM gobuild-base AS buildkit-base
65
65
WORKDIR /src
66
66
ENV GOFLAGS=-mod=vendor
67
67
68
- # scan the version/revision info
68
+ # buildkit-version builds stage with version/revision info
69
69
FROM buildkit-base AS buildkit-version
70
70
# TODO: PKG should be inferred from go modules
71
71
RUN --mount=target=. <<'EOT'
@@ -79,7 +79,7 @@ RUN --mount=target=. <<'EOT'
79
79
echo -n "${VERSION}" > /tmp/.version;
80
80
EOT
81
81
82
- # build buildctl binary
82
+ # buildctl builds test cli binary
83
83
FROM buildkit-base AS buildctl
84
84
ENV CGO_ENABLED=0
85
85
ARG TARGETPLATFORM
@@ -93,7 +93,7 @@ RUN --mount=target=. --mount=target=/root/.cache,type=cache \
93
93
if [ "$(xx-info os)" = "linux" ]; then /usr/bin/buildctl --version; fi
94
94
EOT
95
95
96
- # build buildkitd binary
96
+ # buildkitd builds daemon binary
97
97
FROM buildkit-base AS buildkitd
98
98
# BUILDKITD_TAGS defines additional Go build tags for compiling buildkitd
99
99
ARG BUILDKITD_TAGS
@@ -135,7 +135,7 @@ RUN --mount=target=. --mount=target=/root/.cache,type=cache \
135
135
fi
136
136
EOT
137
137
138
- # build dnsname CNI plugin for testing
138
+ # dnsname builds dnsname CNI plugin for testing
139
139
FROM gobuild-base AS dnsname
140
140
WORKDIR /go/src/github.com/containers/dnsname
141
141
ARG DNSNAME_VERSION
@@ -186,7 +186,7 @@ COPY --link --from=buildkitd /usr/bin/buildkitd /
186
186
COPY --link --from=buildctl /usr/bin/buildctl /
187
187
188
188
FROM binaries-$TARGETOS AS binaries
189
- # enable scanning for this stage
189
+ # BUILDKIT_SBOM_SCAN_STAGE enables SBOM scanning for this stage
190
190
ARG BUILDKIT_SBOM_SCAN_STAGE=true
191
191
192
192
FROM --platform=$BUILDPLATFORM alpine:${ALPINE_VERSION} AS releaser
@@ -230,7 +230,7 @@ RUN --mount=target=/root/.cache,type=cache <<EOT
230
230
fi
231
231
EOT
232
232
233
- # containerd v1.6 for integration tests
233
+ # containerd-alt-16 builds containerd v1.6 for integration tests
234
234
FROM gobuild-base AS containerd-alt-16
235
235
WORKDIR /go/src/github.com/containerd/containerd
236
236
ARG CONTAINERD_ALT_VERSION_16
@@ -418,7 +418,7 @@ ENV BUILDKIT_RUN_NETWORK_INTEGRATION_TESTS=1 BUILDKIT_CNI_INIT_LOCK_PATH=/run/bu
418
418
FROM integration-tests AS dev-env
419
419
VOLUME /var/lib/buildkit
420
420
421
- # Rootless mode.
421
+ # rootless builds a rootless variant of buildkitd image
422
422
FROM alpine:${ALPINE_VERSION} AS rootless
423
423
RUN apk add --no-cache fuse3 fuse-overlayfs git openssh pigz shadow-uidmap xz
424
424
RUN adduser -D -u 1000 user \
0 commit comments