1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #15459 from jfrazelle/make-windows-cross-compile-static-daemon-work

make windows cross compile static daemon work
This commit is contained in:
Jessie Frazelle 2015-08-10 17:53:09 -07:00
commit ca8f24679e
3 changed files with 15 additions and 0 deletions

View file

@ -40,6 +40,7 @@ RUN apt-get update && apt-get install -y \
createrepo \
curl \
dpkg-sig \
gcc-mingw-w64 \
git \
iptables \
libapparmor-dev \

View file

@ -7,6 +7,18 @@ BINARY_FULLNAME="$BINARY_NAME$BINARY_EXTENSION"
source "${MAKEDIR}/.go-autogen"
(
if [ "$(go env GOOS)/$(go env GOARCH)" != "$(go env GOHOSTOS)/$(go env GOHOSTARCH)" ]; then
# must be cross-compiling!
case "$(go env GOOS)/$(go env GOARCH)" in
windows/amd64)
export CC=x86_64-w64-mingw32-gcc
export CGO_ENABLED=1
export LDFLAGS_STATIC_DOCKER="${LDFLAGS_STATIC_DOCKER/-linkmode external/} -extld=${CC}"
;;
esac
fi
echo "Building: $DEST/$BINARY_FULLNAME"
go build \
-o "$DEST/$BINARY_FULLNAME" \
@ -16,6 +28,7 @@ go build \
$LDFLAGS_STATIC_DOCKER
" \
./docker
)
echo "Created binary: $DEST/$BINARY_FULLNAME"
ln -sf "$BINARY_FULLNAME" "$DEST/docker$BINARY_EXTENSION"

View file

@ -5,6 +5,7 @@ set -e
declare -A daemonSupporting
daemonSupporting=(
[linux/amd64]=1
[windows/amd64]=1
)
# if we have our linux/amd64 version compiled, let's symlink it in