-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Closed
Description
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"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels