Skip to content

Commit 513b207

Browse files
authored
Merge pull request #40439 from cpuguy83/fix_windows_cross
Fix windows cross builds.
2 parents 40190ad + 5dffe74 commit 513b207

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ FROM binary-base AS build-cross
354354
ARG DOCKER_CROSSPLATFORMS
355355
RUN --mount=type=cache,target=/root/.cache/go-build \
356356
--mount=type=bind,target=/go/src/github.com/docker/docker \
357+
--mount=type=tmpfs,target=/go/src/github.com/docker/docker/autogen \
357358
hack/make.sh cross
358359

359360
FROM scratch AS binary

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,14 @@ cross: ## cross build the binaries for darwin, freebsd and\nwindows
172172

173173
cross: BUILD_OPTS += --build-arg CROSS=true --build-arg DOCKER_CROSSPLATFORMS
174174

175-
binary dynbinary cross: buildx
175+
# This is only used to work around read-only bind mounts of the source code into
176+
# binary build targets. We end up mounting a tmpfs over autogen which allows us
177+
# to write build-time generated assets even though the source is mounted read-only
178+
# ...But in order to do so, this dir needs to already exist.
179+
autogen:
180+
mkdir -p autogen
181+
182+
binary dynbinary cross: buildx autogen
176183
$(BUILD_CMD) $(BUILD_OPTS) --output=bundles/ --target=$@ $(VERSION_AUTOGEN_ARGS) .
177184

178185
build: target = --target=final

hack/make/.go-autogen

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
rm -rf autogen
3+
rm -rf autogen/*
44

55
source hack/dockerfile/install/runc.installer
66
source hack/dockerfile/install/tini.installer

0 commit comments

Comments
 (0)