Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building Windows version fails #41519

Closed
CaptainFlint opened this issue Oct 2, 2020 · 3 comments · Fixed by #44546
Closed

Building Windows version fails #41519

CaptainFlint opened this issue Oct 2, 2020 · 3 comments · Fixed by #44546

Comments

@CaptainFlint
Copy link

When I try to build Windows version on a Linux machine, it ends up like this:

docker run --rm -i --privileged  -e DOCKER_CROSSPLATFORMS -e BUILD_APT_MIRROR -e BUILDFLAGS -e KEEPBUNDLE -e DOCKER_BUILD_ARGS -e DOCKER_BUILD_GOGC -e DOCKER_BUILD_OPTS -e DOCKER_BUILD_PKGS -e DOCKER_BUILDKIT -e DOCKER_BASH_COMPLETION_PATH -e DOCKER_CLI_PATH -e DOCKER_DEBUG -e DOCKER_EXPERIMENTAL -e DOCKER_GITCOMMIT -e DOCKER_GRAPHDRIVER -e DOCKER_LDFLAGS -e DOCKER_PORT -e DOCKER_REMAP_ROOT -e DOCKER_STORAGE_OPTS -e DOCKER_TEST_HOST -e DOCKER_USERLANDPROXY -e DOCKERD_ARGS -e TEST_INTEGRATION_DIR -e TEST_SKIP_INTEGRATION -e TEST_SKIP_INTEGRATION_CLI -e TESTDEBUG -e TESTDIRS -e TESTFLAGS -e TESTFLAGS_INTEGRATION -e TESTFLAGS_INTEGRATION_CLI -e TEST_FILTER -e TIMEOUT -e VALIDATE_REPO -e VALIDATE_BRANCH -e VALIDATE_ORIGIN_BRANCH -e HTTP_PROXY -e HTTPS_PROXY -e NO_PROXY -e http_proxy -e https_proxy -e no_proxy -e VERSION -e PLATFORM -e DEFAULT_PRODUCT_LICENSE -e PRODUCT -v "/root/moby/bundles:/go/src/github.com/docker/docker/bundles" -v "/root/moby/.git:/go/src/github.com/docker/docker/.git" -v docker-dev-cache:/root/.cache    "docker-dev:vz7u15" DOCKER_CROSSPLATFORMS=windows/amd64 hack/make.sh cross
hack/dind: 29: exec: DOCKER_CROSSPLATFORMS=windows/amd64: not found
make: *** [win] Error 127

I edited the Makefile by moving the variable devinition in front of the command:

 win: build ## cross build the binary for windows
-       $(DOCKER_RUN_DOCKER) DOCKER_CROSSPLATFORMS=windows/amd64 hack/make.sh cross
+       DOCKER_CROSSPLATFORMS=windows/amd64 $(DOCKER_RUN_DOCKER) hack/make.sh cross

This way it worked fine. Also, in the "run" target I can see a different approach, with explicit call of the shell executable. It could be used here as well:

$(DOCKER_RUN_DOCKER) sh -c "DOCKER_CROSSPLATFORMS=windows/amd64 hack/make.sh cross"
@sryze
Copy link

sryze commented Oct 25, 2020

I ran into the same problem, fixed it by adding env in front of the var:

$(DOCKER_RUN_DOCKER) env DOCKER_CROSSPLATFORMS=windows/amd64 hack/make.sh cross

But after the build is finished, I can't find the resulting binaries... are they supposed to be under bundles/? because it's empty for me

@CaptainFlint
Copy link
Author

For me it's under bundles/cross/windows/amd64, two files: containerutility.exe and dockerd-SUFFIX.exe.

sryze added a commit to sryze/moby that referenced this issue Oct 26, 2020
Fixes moby#41519

Signed-off-by: Sergey Zolotarev <sryze@protonmail.com>
@rgl
Copy link
Contributor

rgl commented Dec 9, 2020

I was also having trouble building this at https://github.com/rgl/docker-ce-windows-binaries-vagrant/actions; but with #41590 it builds fine.

Isn't #41590 OK be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants