File tree 2 files changed +24
-17
lines changed
2 files changed +24
-17
lines changed Original file line number Diff line number Diff line change @@ -9,18 +9,10 @@ RUN apt-get update && \
9
9
easy_install pip && pip install virtualenv
10
10
11
11
# Install build dependencies
12
- RUN go get github.com/mitchellh/gox && \
13
- go get github.com/aktau/github-release && \
12
+ RUN go get github.com/aktau/github-release && \
14
13
go get golang.org/x/tools/cmd/cover && \
15
14
go get github.com/golang/lint/golint
16
15
17
- # Compile Go for cross compilation
18
- ENV DOCKER_CROSSPLATFORMS \
19
- linux/386 linux/arm \
20
- darwin/amd64 darwin/386 \
21
- freebsd/amd64 freebsd/386 freebsd/arm \
22
- windows/amd64 windows/386
23
-
24
16
# Which docker version to test on and what default one to use
25
17
ENV DOCKER_VERSIONS 1.9.1 1.10.3 1.11.0
26
18
ENV DEFAULT_DOCKER_VERSION 1.10.3
Original file line number Diff line number Diff line change 2
2
set -e
3
3
4
4
if [ -z " $1 " ]; then
5
- OS_PLATFORM_ARG=(-os=" darwin linux windows" )
5
+ # Remove windows platform because of
6
+ # https://github.com/mailgun/log/issues/10
7
+ OS_PLATFORM_ARG=(linux windows darwin freebsd)
6
8
else
7
9
OS_PLATFORM_ARG=($1 )
8
10
fi
9
11
10
12
if [ -z " $2 " ]; then
11
- OS_ARCH_ARG=(-arch= " 386 amd64 arm" )
13
+ OS_ARCH_ARG=(386 amd64 arm)
12
14
else
13
15
OS_ARCH_ARG=($2 )
14
16
fi
15
17
16
18
# Get rid of existing binaries
17
- rm -f libcompose-cli*
19
+ rm -f bundles/ libcompose-cli*
18
20
19
21
# Build binaries
20
- gox " ${OS_PLATFORM_ARG[@]} " " ${OS_ARCH_ARG[@]} " \
21
- -output=" bundles/libcompose-cli_{{.OS}}-{{.Arch}}" \
22
- -ldflags=" -w -X github.com/docker/libcompose/version.GITCOMMIT=` git rev-parse --short HEAD` " \
23
- ./cli/main
24
-
22
+ for OS in ${OS_PLATFORM_ARG[@]} ; do
23
+ for ARCH in ${OS_ARCH_ARG[@]} ; do
24
+ OUTPUT_BIN=" bundles/libcompose-cli_$OS -$ARCH "
25
+ if test " $ARCH " = " arm" ; then
26
+ if test " $OS " = " windows" || test " $OS " = " darwin" ; then
27
+ # windows/arm and darwin/arm does not compile without cgo :-|
28
+ continue
29
+ fi
30
+ fi
31
+ if test " $OS " = " windows" ; then
32
+ OUTPUT_BIN=" ${OUTPUT_BIN} .exe"
33
+ fi
34
+ echo " Building binary for $OS /$ARCH ..."
35
+ GOARCH=$ARCH GOOS=$OS CGO_ENABLED=0 go build \
36
+ -ldflags=" -w -X github.com/docker/libcompose/version.GITCOMMIT=` git rev-parse --short HEAD` " \
37
+ -o ${OUTPUT_BIN} ./cli/main
38
+ done
39
+ done
You can’t perform that action at this time.
0 commit comments