mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
make windows cross compile static daemon work
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
This commit is contained in:
parent
4293861c1e
commit
e62745922f
3 changed files with 15 additions and 0 deletions
|
@ -40,6 +40,7 @@ RUN apt-get update && apt-get install -y \
|
|||
createrepo \
|
||||
curl \
|
||||
dpkg-sig \
|
||||
gcc-mingw-w64 \
|
||||
git \
|
||||
iptables \
|
||||
libapparmor-dev \
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue