From beb7c759eb78fb6ba82232ac50c708e7540906eb Mon Sep 17 00:00:00 2001 From: Dieter Reuter Date: Sat, 3 Dec 2016 11:32:37 +0100 Subject: [PATCH] Add support for running builds within an QEMU emulation With this change we can run a Docker build in QEMU and build ARM or ARM64 binaries directly on an Intel build machine. This feature already supports building with Docker4Mac (Beta31). So it's easy for a developer to compile and test the Docker binaries locally on his dev machine w/o the need of the target hardware. Another use case would be to run builds on a clound CI like Travis to get an instant feedback loop for PR's, all on a common Intel platform w/o the need to set up the CI system on the target hardware. Usage: build static Docker binaries for ARM 32-bit ``` DOCKER_ENGINE_OSARCH="linux/arm" make binary ``` Usage: build static Docker binaries for ARM64 aka AARCH64 ``` DOCKER_ENGINE_OSARCH="linux/arm64" make binary ``` Signed-off-by: Dieter Reuter Upstream-commit: 0d7e118f0199102924c318c80b7e7a10720e1874 Component: engine --- components/engine/hack/make/.detect-daemon-osarch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/engine/hack/make/.detect-daemon-osarch b/components/engine/hack/make/.detect-daemon-osarch index 73955392d0..d6b41c8666 100644 --- a/components/engine/hack/make/.detect-daemon-osarch +++ b/components/engine/hack/make/.detect-daemon-osarch @@ -19,7 +19,7 @@ docker-version-osarch() { } # Retrieve OS/ARCH of docker daemon, e.g. linux/amd64 -export DOCKER_ENGINE_OSARCH="$(docker-version-osarch 'Server')" +export DOCKER_ENGINE_OSARCH="${DOCKER_ENGINE_OSARCH:=$(docker-version-osarch 'Server')}" export DOCKER_ENGINE_GOOS="${DOCKER_ENGINE_OSARCH%/*}" export DOCKER_ENGINE_GOARCH="${DOCKER_ENGINE_OSARCH##*/}" DOCKER_ENGINE_GOARCH=${DOCKER_ENGINE_GOARCH:=amd64}