mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-14 08:53:48 +01:00
Add cross compilation scripts
This commit is contained in:
parent
d4b34dd49f
commit
d318e68423
5 changed files with 85 additions and 34 deletions
32
Dockerfile.build
Normal file
32
Dockerfile.build
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue