Use base image, add Makefile, compress RUN statements to save on disk space

Signed-off-by: Steeve Morin <steeve.morin@gmail.com>
This commit is contained in:
Steeve Morin 2014-10-17 13:42:56 +02:00
parent 2b82f22e0b
commit 703053871c
No known key found for this signature in database
GPG Key ID: 6323FE5975269E7A
11 changed files with 93 additions and 58 deletions

15
Makefile Normal file
View File

@ -0,0 +1,15 @@
PLATFORMS = base \
android-arm \
darwin-x64 \
linux-x86 \
linux-x64 \
linux-arm \
windows-x86 \
windows-x64
DOCKER = docker
IMAGE = steeve/cross-compiler
all:
for i in $(PLATFORMS); do \
$(DOCKER) build -t $(IMAGE):$$i $$i ; \
done

View File

@ -1,4 +1,4 @@
FROM debian:jessie FROM steeve/cross-compiler:base
MAINTAINER Steeve Morin "steeve.morin@gmail.com" MAINTAINER Steeve Morin "steeve.morin@gmail.com"
RUN apt-get update && apt-get -y --force-yes install \ RUN apt-get update && apt-get -y --force-yes install \
@ -10,14 +10,14 @@ RUN apt-get update && apt-get -y --force-yes install \
tar xz-utils bzip2 gzip sed tar xz-utils bzip2 gzip sed
ENV CROSS_TRIPLE arm-linux-androideabi ENV CROSS_TRIPLE arm-linux-androideabi
ENV CROSS_ROOT /gcc-${CROSS_TRIPLE} ENV CROSS_ROOT /usr/${CROSS_TRIPLE}
ENV PATH ${PATH}:${CROSS_ROOT}/bin ENV PATH ${PATH}:${CROSS_ROOT}/bin
ENV LD_LIBRARY_PATH ${CROSS_ROOT}/lib:${LD_LIBRARY_PATH} ENV LD_LIBRARY_PATH ${CROSS_ROOT}/lib:${LD_LIBRARY_PATH}
RUN mkdir -p /build && \ RUN mkdir -p /build && \
cd /build && \ cd /build && \
curl -L http://dl.google.com/android/ndk/android-ndk32-r10-linux-x86_64.tar.bz2 | tar xvj && \ curl -L http://dl.google.com/android/ndk/android-ndk32-r10b-linux-x86_64.tar.bz2 | tar xvj && \
cd /build/android-ndk-r10 && \ cd /build/android-ndk-r10b && \
/bin/bash ./build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=${CROSS_ROOT} && \ /bin/bash ./build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=${CROSS_ROOT} && \
cd / && \ cd / && \
rm -rf /build rm -rf /build

15
base/Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM debian:jessie
MAINTAINER Steeve Morin "steeve.morin@gmail.com"
RUN apt-get update && apt-get -y install \
bash \
curl \
pkg-config \
build-essential \
file \
rsync \
tar \
xz-utils \
bzip2 \
gzip \
sed

View File

@ -1,26 +1,22 @@
FROM debian:jessie FROM steeve/cross-compiler:base
MAINTAINER Steeve Morin "steeve.morin@gmail.com" MAINTAINER Steeve Morin "steeve.morin@gmail.com"
RUN apt-get update && apt-get -y --force-yes install \
bash \
curl \
pkg-config \
build-essential \
clang-3.5 llvm-3.5-dev automake autogen \
libtool libxml2-dev uuid-dev libssl-dev bash patch make \
tar xz-utils bzip2 gzip sed cpio
ENV CROSS_TRIPLE x86_64-apple-darwin13 ENV CROSS_TRIPLE x86_64-apple-darwin13
ENV CROSS_ROOT /clang-${CROSS_TRIPLE} ENV CROSS_ROOT /usr/${CROSS_TRIPLE}
ENV MAC_SDK_VERSION 10.9
ENV PATH ${PATH}:${CROSS_ROOT}/bin ENV PATH ${PATH}:${CROSS_ROOT}/bin
ENV LD_LIBRARY_PATH /usr/lib/llvm-3.5/lib:${CROSS_ROOT}/lib:${LD_LIBRARY_PATH} ENV LD_LIBRARY_PATH /usr/lib/llvm-3.5/lib:${CROSS_ROOT}/lib
ENV MAC_SDK_VERSION 10.9
RUN curl -L https://github.com/tpoechtrager/osxcross/archive/master.tar.gz | tar xvz RUN curl -L https://github.com/tpoechtrager/osxcross/archive/master.tar.gz | tar xvz
COPY MacOSX${MAC_SDK_VERSION}.sdk.tar.bz2 /osxcross-master/tarballs/ COPY MacOSX${MAC_SDK_VERSION}.sdk.tar.bz2 /osxcross-master/tarballs/
# Build the toolchain # Build the toolchain
RUN cd /osxcross-master && echo | SDK_VERSION=${MAC_SDK_VERSION} OSX_VERSION_MIN=10.6 ./build.sh WORKDIR /osxcross-master
RUN mv /osxcross-master/target ${CROSS_ROOT} && \
RUN ./tools/get_dependencies.sh && \
echo | SDK_VERSION=${MAC_SDK_VERSION} OSX_VERSION_MIN=10.6 ./build.sh && \
mv /osxcross-master/target ${CROSS_ROOT} && \
mkdir -p ${CROSS_ROOT}/lib && \ mkdir -p ${CROSS_ROOT}/lib && \
rm -rf /osxcross-master rm -rf /osxcross-master
WORKDIR /

View File

@ -1,15 +1,6 @@
FROM debian:jessie FROM steeve/cross-compiler:base
MAINTAINER Steeve Morin "steeve.morin@gmail.com" MAINTAINER Steeve Morin "steeve.morin@gmail.com"
RUN apt-get update && apt-get -y --force-yes install \
bash \
curl \
pkg-config \
build-essential \
file \
rsync \
tar xz-utils bzip2 gzip sed
ENV CROSS_TRIPLE arm-linux-gnueabihf ENV CROSS_TRIPLE arm-linux-gnueabihf
ENV CROSS_ROOT /usr/${CROSS_TRIPLE} ENV CROSS_ROOT /usr/${CROSS_TRIPLE}
ENV PATH ${PATH}:${CROSS_ROOT}/bin ENV PATH ${PATH}:${CROSS_ROOT}/bin

View File

@ -1,21 +1,12 @@
FROM debian:jessie FROM steeve/cross-compiler:base
MAINTAINER Steeve Morin "steeve.morin@gmail.com" MAINTAINER Steeve Morin "steeve.morin@gmail.com"
RUN apt-get update && apt-get -y --force-yes install \
bash \
curl \
pkg-config \
build-essential \
file \
tar xz-utils bzip2 gzip sed
# Add the cross compiler sources # Add the cross compiler sources
RUN echo "deb http://toolchains.secretsauce.net unstable main" >> /etc/apt/sources.list && \ RUN echo "deb http://toolchains.secretsauce.net unstable main" >> /etc/apt/sources.list && \
dpkg --add-architecture armhf && \ dpkg --add-architecture armhf && \
curl -L http://toolchains.secretsauce.net/key.gpg | apt-key add - curl -L http://toolchains.secretsauce.net/key.gpg | apt-key add -
RUN apt-get update && apt-get -y --force-yes install \ RUN apt-get update && apt-get -y install \
gcc-4.9-arm-linux-gnueabihf \ gcc-4.9-arm-linux-gnueabihf \
g++-4.9-arm-linux-gnueabihf g++-4.9-arm-linux-gnueabihf

12
linux-x64/Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM steeve/cross-compiler:base
MAINTAINER Steeve Morin "steeve.morin@gmail.com"
ENV CROSS_TRIPLE x86_64-linux-gnu
ENV CROSS_ROOT /usr/${CROSS_TRIPLE}
ENV PATH ${PATH}:${CROSS_ROOT}/bin
ENV LD_LIBRARY_PATH ${CROSS_ROOT}/lib:${LD_LIBRARY_PATH}
RUN mkdir -p ${CROSS_ROOT} && \
cd /usr/bin && \
ln -s ${CROSS_TRIPLE}-gcc ${CROSS_TRIPLE}-cc && \
ln -s ${CROSS_TRIPLE}-g++ ${CROSS_TRIPLE}-c++

27
linux-x86/Dockerfile Normal file
View File

@ -0,0 +1,27 @@
FROM steeve/cross-compiler:base
MAINTAINER Steeve Morin "steeve.morin@gmail.com"
RUN apt-get update && apt-get -y install \
gcc-multilib \
g++-multilib
ENV CROSS_TRIPLE i686-linux-gnu
ENV CROSS_ROOT /usr/i686-linux-gnu
ENV PATH ${PATH}:${CROSS_ROOT}/bin
ENV LD_LIBRARY_PATH ${CROSS_ROOT}/lib:${LD_LIBRARY_PATH}
COPY ${CROSS_TRIPLE}.sh /usr/bin/${CROSS_TRIPLE}.sh
RUN mkdir -p ${CROSS_ROOT} && \
cd /usr/bin && \
chmod +x ${CROSS_TRIPLE}.sh && \
ln -s x86_64-linux-gnu-gcc x86_64-linux-gnu-cc && \
ln -s x86_64-linux-gnu-g++ x86_64-linux-gnu-c++ && \
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-gcc-4.9 && \
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-gcc && \
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-cc && \
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-g++-4.9 && \
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-g++ && \
ln -s ${CROSS_TRIPLE}.sh ${CROSS_TRIPLE}-c++ && \
for i in x86_64-linux-gnu-*; do \
ln -s $i `echo $i | sed "s/x86_64-linux-gnu-/${CROSS_TRIPLE}-/"`; \
done

View File

@ -0,0 +1,2 @@
#!/bin/bash
exec ${0/${CROSS_TRIPLE}-/x86_64-linux-gnu-} -m32 "$@"

View File

@ -1,14 +1,7 @@
FROM debian:jessie FROM steeve/cross-compiler:base
MAINTAINER Steeve Morin "steeve.morin@gmail.com" MAINTAINER Steeve Morin "steeve.morin@gmail.com"
RUN apt-get update && apt-get -y --force-yes install \ RUN apt-get update && apt-get -y install mingw-w64
bash \
curl \
pkg-config \
build-essential \
file \
mingw-w64 \
tar xz-utils bzip2 gzip sed
ENV CROSS_TRIPLE x86_64-w64-mingw32 ENV CROSS_TRIPLE x86_64-w64-mingw32
ENV CROSS_ROOT /usr/${CROSS_TRIPLE} ENV CROSS_ROOT /usr/${CROSS_TRIPLE}

View File

@ -1,14 +1,7 @@
FROM debian:jessie FROM steeve/cross-compiler:base
MAINTAINER Steeve Morin "steeve.morin@gmail.com" MAINTAINER Steeve Morin "steeve.morin@gmail.com"
RUN apt-get update && apt-get -y --force-yes install \ RUN apt-get update && apt-get -y install mingw-w64
bash \
curl \
pkg-config \
build-essential \
file \
mingw-w64 \
tar xz-utils bzip2 gzip sed
ENV CROSS_TRIPLE i686-w64-mingw32 ENV CROSS_TRIPLE i686-w64-mingw32
ENV CROSS_ROOT /usr/${CROSS_TRIPLE} ENV CROSS_ROOT /usr/${CROSS_TRIPLE}