osx cross

Fix CI build

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: a408fb0a61
Component: cli
This commit is contained in:
Daniel Nephin
2017-05-13 13:47:00 -04:00
parent fa3049db08
commit 71ca4e1c02
10 changed files with 77 additions and 43 deletions
-29
View File
@@ -1,29 +0,0 @@
#
# This Dockerfile makes the docker builder run the tests.
# It means that if this Dockerfile can be built successfully,
# the tests passed.
#
# From the repo root dir:
# $ docker build -f dockerfiles/Dockerfile.ci .
#
FROM golang:1.8-alpine
RUN apk add -U git make
RUN go get github.com/LK4D4/vndr && \
cp /go/bin/vndr /usr/bin && \
rm -rf /go/src/* /go/pkg/* /go/bin/*
RUN go get github.com/mitchellh/gox && \
cp /go/bin/gox /usr/bin && \
rm -rf /go/src/* /go/pkg/* /go/bin/*
RUN go get github.com/jteeuwen/go-bindata/go-bindata && \
cp /go/bin/go-bindata /usr/bin && \
rm -rf /go/src/* /go/pkg/* /go/bin/*
COPY . /go/src/github.com/docker/cli
ENV CGO_ENABLED=0
WORKDIR /go/src/github.com/docker/cli
+5 -1
View File
@@ -5,7 +5,7 @@ FROM golang:1.8.1
ARG APT_MIRROR=deb.debian.org
RUN sed -ri "s/(httpredir|deb).debian.org/$APT_MIRROR/g" /etc/apt/sources.list
RUN apt-get update && apt-get install -y \
RUN apt-get update -qq && apt-get install -y -q \
libltdl-dev \
gcc-mingw-w64 \
parallel \
@@ -15,4 +15,8 @@ RUN go get github.com/mitchellh/gox && \
cp /go/bin/gox /usr/bin && \
rm -rf /go/src/* /go/pkg/* /go/bin/*
COPY dockerfiles/osx-cross.sh /tmp/
RUN /tmp/osx-cross.sh
ENV PATH /osxcross/target/bin:$PATH
WORKDIR /go/src/github.com/docker/cli
@@ -1,7 +1,7 @@
FROM golang:1.8-alpine
RUN apk add -U git make bash
RUN apk add -U git make bash coreutils
RUN go get github.com/LK4D4/vndr && \
cp /go/bin/vndr /usr/bin && \
@@ -7,6 +7,5 @@ RUN go get -u gopkg.in/alecthomas/gometalinter.v1 && \
gometalinter --install
WORKDIR /go/src/github.com/docker/cli
COPY . .
ENTRYPOINT ["/usr/local/bin/gometalinter"]
CMD ["--config=gometalinter.json", "./..."]
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
#
# Install dependencies required to cross compile osx, then cleanup
#
# TODO: this should be a separate build stage when CI supports it
set -eu -o pipefail
PKG_DEPS="patch xz-utils clang"
apt-get update -qq
apt-get install -y -q $PKG_DEPS
OSX_SDK=MacOSX10.11.sdk
OSX_CROSS_COMMIT=a9317c18a3a457ca0a657f08cc4d0d43c6cf8953
OSXCROSS_PATH="/osxcross"
echo "Cloning osxcross"
time git clone https://github.com/tpoechtrager/osxcross.git $OSXCROSS_PATH
cd $OSXCROSS_PATH
git checkout -q $OSX_CROSS_COMMIT
echo "Downloading OSX SDK"
time curl -sSL https://s3.dockerproject.org/darwin/v2/${OSX_SDK}.tar.xz \
-o "${OSXCROSS_PATH}/tarballs/${OSX_SDK}.tar.xz"
echo "Buidling osxcross"
UNATTENDED=yes OSX_VERSION_MIN=10.6 ${OSXCROSS_PATH}/build.sh > /dev/null