# this container is used for compiling dbmate against multiple targets FROM golang:1.5.1 ENV CGO_ENABLED 1 # i386 cross compilation RUN dpkg --add-architecture i386 && \ apt-get update && \ apt-get install -y libc6-dev-i386 && \ rm -rf /var/lib/apt/lists/* # osx cross compilation # ref: https://github.com/karalabe/xgo/blob/master/docker/base/Dockerfile ENV OSX_SDK_VERSION 10.9 RUN cd /opt && \ git clone https://github.com/tpoechtrager/osxcross.git && \ cd osxcross && \ sed -i -e 's|-march=native||g' ./build_clang.sh ./wrapper/build.sh && \ apt-get update && \ ./tools/get_dependencies.sh && \ rm -rf /var/lib/apt/lists/* && \ curl -fSL -o ./tarballs/MacOSX${OSX_SDK_VERSION}.sdk.tar.xz \ https://s3.amazonaws.com/andrew-osx-sdks/MacOSX${OSX_SDK_VERSION}.sdk.tar.xz && \ UNATTENDED=1 OSX_VERSION_MIN=10.6 ./build.sh ENV PATH /opt/osxcross/target/bin:$PATH # copy source files COPY . $GOPATH/src/github.com/adrianmacneil/dbmate WORKDIR $GOPATH/src/github.com/adrianmacneil/dbmate # fetch dependencies RUN go get -d -t -v