-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clamped to officially update once per week, but written such that a BUILDKIT_COMMIT build-arg can build any commit.
- Loading branch information
Showing
7 changed files
with
167 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# | ||
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh" | ||
# | ||
# PLEASE DO NOT EDIT IT DIRECTLY. | ||
# | ||
|
||
FROM --platform=$BUILDPLATFORM golang:1.22 AS build | ||
|
||
# https://github.com/moby/buildkit/commits/HEAD | ||
ARG BUILDKIT_COMMIT=38a47dbbc69d4640a052a662611aece3427164c0 | ||
# https://github.com/moby/buildkit/tree/38a47dbbc69d4640a052a662611aece3427164c0 -- 2024-11-28T20:16:34.000+01:00 (@1732821394) | ||
ENV BUILDKIT_COMMIT $BUILDKIT_COMMIT | ||
|
||
COPY \ | ||
argsescaped.patch \ | ||
containerd-arm64-v8.patch \ | ||
git-no-submodules.patch \ | ||
mips64le.patch \ | ||
noclip.patch \ | ||
nolint.patch \ | ||
/tmp/buildkit-patches/ | ||
|
||
WORKDIR /app | ||
|
||
RUN set -eux; \ | ||
git init --quiet; \ | ||
git config advice.detachedHead false; \ | ||
git fetch --depth 1 'https://github.com/moby/buildkit.git' "$BUILDKIT_COMMIT:"; \ | ||
git checkout FETCH_HEAD; \ | ||
for patch in /tmp/buildkit-patches/*.patch; do \ | ||
git apply --verbose "$patch"; \ | ||
done; \ | ||
git diff --color | ||
|
||
ENV CGO_ENABLED 0 | ||
|
||
ARG TARGETOS TARGETARCH TARGETVARIANT | ||
ENV GOOS=$TARGETOS GOARCH=$TARGETARCH VARIANT=$TARGETVARIANT | ||
|
||
RUN set -eux; \ | ||
case "$GOARCH/$VARIANT" in \ | ||
amd64/*) export GOAMD64="$VARIANT" ;; \ | ||
arm/*) export GOARM="${VARIANT#v}" ;; \ | ||
arm64/v8) ;; \ | ||
*) [ -z "$VARIANT" ] ;; \ | ||
esac; \ | ||
go env | grep -E 'OS=|ARCH=|AMD64=|ARM64=|ARM='; \ | ||
\ | ||
# https://github.com/moby/buildkit/blob/v0.13.2/Dockerfile#L93 | ||
pkg='github.com/moby/buildkit'; \ | ||
ldflags=" \ | ||
-d -w \ | ||
-X '$pkg/version.Version=dev-tianon' \ | ||
-X '$pkg/version.Revision=$BUILDKIT_COMMIT+tianon-patches' \ | ||
-X '$pkg/version.Package=$pkg' \ | ||
"; \ | ||
go build -o /buildkitd -trimpath -ldflags "$ldflags" ./cmd/buildkitd; \ | ||
go build -o /buildctl -trimpath -ldflags "$ldflags" ./cmd/buildctl; \ | ||
\ | ||
# https://github.com/moby/buildkit/blob/v0.14.0/frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile#L21 | ||
pkg='github.com/moby/buildkit/frontend/dockerfile/cmd/dockerfile-frontend'; \ | ||
ldflags=" \ | ||
-d -w \ | ||
-X '$pkg/version.Version=dev-tianon' \ | ||
-X '$pkg/version.Revision=$BUILDKIT_COMMIT+tianon-patches' \ | ||
-X '$pkg/version.Package=$pkg' \ | ||
"; \ | ||
go build -o /dockerfile-frontend -trimpath -ldflags "$ldflags" ./frontend/dockerfile/cmd/dockerfile-frontend | ||
|
||
FROM --platform=$TARGETPLATFORM infosiftr/moby | ||
|
||
RUN set -eux; \ | ||
apt-get update; \ | ||
apt-get install -y --no-install-recommends git; \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=build --link /buildkitd /buildctl /dockerfile-frontend /usr/local/bin/ | ||
COPY buildkitd-entrypoint.sh /usr/local/bin/ | ||
|
||
VOLUME /var/lib/buildkit | ||
|
||
# https://github.com/docker/buildx/issues/484#issuecomment-749352728 | ||
ENV BUILDKIT_STEP_LOG_MAX_SIZE -1 | ||
ENV BUILDKIT_STEP_LOG_MAX_SPEED -1 | ||
|
||
# https://github.com/moby/buildkit/blob/v0.14.0/frontend/gateway/gateway.go#L309 | ||
# https://github.com/moby/buildkit/blob/v0.14.0/frontend/dockerfile/cmd/dockerfile-frontend/Dockerfile#L35-L36 | ||
LABEL moby.buildkit.frontend.network.none="true" | ||
LABEL moby.buildkit.frontend.caps="moby.buildkit.frontend.inputs,moby.buildkit.frontend.subrequests,moby.buildkit.frontend.contexts" | ||
|
||
ENTRYPOINT ["buildkitd-entrypoint.sh"] | ||
CMD [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters