mirror of
https://github.com/bensuperpc/dockcross.git
synced 2024-11-09 20:57:26 +01:00
dockcross: make the default image specific to each compiler
This commit is contained in:
parent
aa06b9af2c
commit
fdb18671e3
@ -31,5 +31,7 @@ RUN mkdir -p /build && \
|
||||
cd / && \
|
||||
rm -rf /build
|
||||
|
||||
ENV DEFAULT_DOCKCROSS_IMAGE thewtex/cross-compiler-android-arm
|
||||
|
||||
COPY Toolchain.cmake ${CROSS_ROOT}/
|
||||
ENV CMAKE_TOOLCHAIN_FILE ${CROSS_ROOT}/Toolchain.cmake
|
||||
|
@ -36,4 +36,6 @@ RUN cd /tmp && \
|
||||
$CC /tmp/first_run.c && \
|
||||
rm /tmp/first_run.* a.out.js
|
||||
|
||||
ENV DEFAULT_DOCKCROSS_IMAGE thewtex/cross-compiler-browser-asmjs
|
||||
|
||||
ENV CMAKE_TOOLCHAIN_FILE /usr/emsdk_portable/emscripten/tag-${EMSCRIPTEN_VERSION}/cmake/Modules/Platform/Emscripten.cmake
|
||||
|
@ -44,7 +44,7 @@ test:
|
||||
- make windows-x86:
|
||||
timeout: 3000
|
||||
- docker run --rm -v ~/cross-compilers/test/:/usr/src/test:ro thewtex/cross-compiler-windows-x86 python /usr/src/test/run.py --emulator /usr/bin/wine --exe-suffix ".exe"
|
||||
- docker run thewtex/cross-compiler-linux-armv7 > dockcross && chmod +x dockcross && ./dockcross gcc test/C/hello.c -o hello_arm
|
||||
- docker run thewtex/cross-compiler-linux-armv7 > ./dockcross && chmod +x ./dockcross && ./dockcross bash -c '$CC test/C/hello.c -o hello_arm'
|
||||
|
||||
deployment:
|
||||
hub:
|
||||
|
@ -23,3 +23,5 @@ RUN curl -L https://github.com/tpoechtrager/osxcross/archive/master.tar.gz | tar
|
||||
mv /osxcross-master/target ${CROSS_ROOT} && \
|
||||
mkdir -p ${CROSS_ROOT}/lib && \
|
||||
rm -rf /osxcross-master
|
||||
|
||||
ENV DEFAULT_DOCKCROSS_IMAGE thewtex/cross-compiler-darwin-x64
|
||||
|
@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
DEFAULT_DOCKCROSS_IMAGE=thewtex/cross-compiler-base
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Helpers
|
||||
#
|
||||
@ -123,14 +125,13 @@ done
|
||||
# 3. defaults
|
||||
|
||||
# Source the config file if it exists
|
||||
DEFAULT_CONFIG=~/.dockcross
|
||||
FINAL_CONFIG=${ARG_CONFIG-${DOCKCROSS_CONFIG-$DEFAULT_CONFIG}}
|
||||
DEFAULT_DOCKCROSS_CONFIG=~/.dockcross
|
||||
FINAL_CONFIG=${ARG_CONFIG-${DOCKCROSS_CONFIG-$DEFAULT_DOCKCROSS_CONFIG}}
|
||||
|
||||
[[ -f "$FINAL_CONFIG" ]] && source "$FINAL_CONFIG"
|
||||
|
||||
# Set the docker image
|
||||
DEFAULT_IMAGE=thewtex/cross-compiler-base
|
||||
FINAL_IMAGE=${ARG_IMAGE-${DOCKCROSS_IMAGE-$DEFAULT_IMAGE}}
|
||||
FINAL_IMAGE=${ARG_IMAGE-${DOCKCROSS_IMAGE-$DEFAULT_DOCKCROSS_IMAGE}}
|
||||
|
||||
# Set the docker run extra args (if any)
|
||||
FINAL_ARGS=${ARG_ARGS-${DOCKCROSS_ARGS}}
|
||||
@ -178,11 +179,12 @@ docker run -i -t --rm \
|
||||
#
|
||||
# This image is not intended to be run manually.
|
||||
#
|
||||
# To install the dockcross helper, run the following commands:
|
||||
# To create a dockcross helper script for the
|
||||
# thewtex/cross-compiler-linux-armv7 image, run:
|
||||
#
|
||||
# docker run thewtex/cross-compiler-linux-armv7 > dockcross
|
||||
# docker run --rm thewtex/cross-compiler-linux-armv7 > dockcross
|
||||
# chmod +x dockcross
|
||||
#
|
||||
# You may then wish to move dockcross to somewhere in your path.
|
||||
# You may then wish to move the dockcross script to somewhere in your path.
|
||||
#
|
||||
################################################################################
|
||||
|
@ -4,8 +4,15 @@
|
||||
# container at runtime.
|
||||
|
||||
if [[ $# == 0 ]]; then
|
||||
# Presumably the image has been run directly, so help the user get started.
|
||||
# Presumably the image has been run directly, so help the user get
|
||||
# started by outputting the dockcross script
|
||||
if [[ -n $DEFAULT_DOCKCROSS_IMAGE ]]; then
|
||||
head -n 2 /dockcross/dockcross
|
||||
echo "DEFAULT_DOCKCROSS_IMAGE=$DEFAULT_DOCKCROSS_IMAGE"
|
||||
tail -n +4 /dockcross/dockcross
|
||||
else
|
||||
cat /dockcross/dockcross
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
@ -27,3 +27,5 @@ ENV AS=/usr/bin/${CROSS_TRIPLE}-as \
|
||||
|
||||
ENV QEMU_LD_PREFIX ${CROSS_ROOT}/libc
|
||||
ENV QEMU_SET_ENV "LD_LIBRARY_PATH=${CROSS_ROOT}/lib:${CROSS_ROOT}/libc/lib/${CROSS_TRIPLE}/"
|
||||
|
||||
ENV DEFAULT_DOCKCROSS_IMAGE thewtex/cross-compiler-linux-armv5
|
||||
|
@ -39,5 +39,7 @@ RUN mkdir rpi_tools && cd rpi_tools && git init && git remote add -f origin http
|
||||
ENV QEMU_LD_PREFIX ${CROSS_ROOT}/libc
|
||||
ENV QEMU_SET_ENV "LD_LIBRARY_PATH=${CROSS_ROOT}/lib:${CROSS_ROOT}/libc/lib/${CROSS_TRIPLE}/"
|
||||
|
||||
ENV DEFAULT_DOCKCROSS_IMAGE thewtex/cross-compiler-linux-armv6
|
||||
|
||||
COPY Toolchain.cmake ${CROSS_ROOT}/
|
||||
ENV CMAKE_TOOLCHAIN_FILE ${CROSS_ROOT}/Toolchain.cmake
|
||||
|
@ -25,7 +25,7 @@ ENV AS=/usr/bin/${CROSS_TRIPLE}-as \
|
||||
CXX=/usr/bin/${CROSS_TRIPLE}-g++ \
|
||||
LD=/usr/bin/${CROSS_TRIPLE}-ld
|
||||
|
||||
WORKDIR /build
|
||||
ENV DEFAULT_DOCKCROSS_IMAGE thewtex/cross-compiler-linux-armv7
|
||||
|
||||
# Note: Toolchain file support is currently in debian Experimental:
|
||||
# https://wiki.debian.org/CrossToolchains#In_jessie_.28Debian_8.29
|
||||
|
@ -34,6 +34,8 @@ ENV AS=/usr/bin/${CROSS_TRIPLE}-as \
|
||||
CXX=/usr/bin/${CROSS_TRIPLE}-g++ \
|
||||
LD=/usr/bin/${CROSS_TRIPLE}-ld
|
||||
|
||||
ENV DEFAULT_DOCKCROSS_IMAGE thewtex/cross-compiler-linux-ppc64le
|
||||
|
||||
# Note: Toolchain file support is currently in debian Experimental according to:
|
||||
# https://wiki.debian.org/CrossToolchains#In_jessie_.28Debian_8.29
|
||||
# We can switch to that when it becomes stable.
|
||||
|
@ -9,3 +9,5 @@ ENV AS=/usr/bin/${CROSS_TRIPLE}-as \
|
||||
CPP=/usr/bin/${CROSS_TRIPLE}-cpp \
|
||||
CXX=/usr/bin/${CROSS_TRIPLE}-g++ \
|
||||
LD=/usr/bin/${CROSS_TRIPLE}-ld
|
||||
|
||||
ENV DEFAULT_DOCKCROSS_IMAGE thewtex/cross-compiler-linux-x64
|
||||
|
@ -34,6 +34,8 @@ ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \
|
||||
CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \
|
||||
CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++
|
||||
|
||||
ENV DEFAULT_DOCKCROSS_IMAGE thewtex/cross-compiler-linux-x86
|
||||
|
||||
# Note: Toolchain file support is currently in debian Experimental:
|
||||
# https://wiki.debian.org/CrossToolchains#In_jessie_.28Debian_8.29
|
||||
COPY Toolchain.cmake /usr/lib/${CROSS_TRIPLE}/
|
||||
|
@ -57,8 +57,6 @@ COPY settings.mk /usr/src/mxe/
|
||||
RUN make -j$(nproc)
|
||||
|
||||
ENV PATH ${PATH}:/usr/src/mxe/usr/bin
|
||||
ENV CMAKE_TOOLCHAIN_FILE /usr/src/mxe/usr/x86_64-w64-mingw32.static/share/cmake/mxe-conf.cmake
|
||||
RUN echo 'set(CMAKE_CROSSCOMPILING_EMULATOR "/usr/bin/wine")' >> ${CMAKE_TOOLCHAIN_FILE}
|
||||
ENV CROSS_TRIPLE x86_64-w64-mingw32.static
|
||||
ENV AS=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-as \
|
||||
AR=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-ar \
|
||||
@ -67,4 +65,8 @@ ENV AS=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-as \
|
||||
CXX=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-g++ \
|
||||
LD=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-ld
|
||||
|
||||
WORKDIR /usr/src
|
||||
ENV DEFAULT_DOCKCROSS_IMAGE thewtex/cross-compiler-windows-x64
|
||||
WORKDIR /build
|
||||
|
||||
ENV CMAKE_TOOLCHAIN_FILE /usr/src/mxe/usr/x86_64-w64-mingw32.static/share/cmake/mxe-conf.cmake
|
||||
RUN echo 'set(CMAKE_CROSSCOMPILING_EMULATOR "/usr/bin/wine")' >> ${CMAKE_TOOLCHAIN_FILE}
|
||||
|
@ -57,8 +57,6 @@ COPY settings.mk /usr/src/mxe/
|
||||
RUN make -j$(nproc)
|
||||
|
||||
ENV PATH ${PATH}:/usr/src/mxe/usr/bin
|
||||
ENV CMAKE_TOOLCHAIN_FILE /usr/src/mxe/usr/i686-w64-mingw32.static/share/cmake/mxe-conf.cmake
|
||||
RUN echo 'set(CMAKE_CROSSCOMPILING_EMULATOR "/usr/bin/wine")' >> ${CMAKE_TOOLCHAIN_FILE}
|
||||
ENV CROSS_TRIPLE i686-w64-mingw32.static
|
||||
ENV AS=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-as \
|
||||
AR=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-ar \
|
||||
@ -67,4 +65,8 @@ ENV AS=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-as \
|
||||
CXX=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-g++ \
|
||||
LD=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-ld
|
||||
|
||||
WORKDIR /usr/src
|
||||
ENV DEFAULT_DOCKCROSS_IMAGE thewtex/cross-compiler-windows-x86
|
||||
WORKDIR /build
|
||||
|
||||
ENV CMAKE_TOOLCHAIN_FILE /usr/src/mxe/usr/i686-w64-mingw32.static/share/cmake/mxe-conf.cmake
|
||||
RUN echo 'set(CMAKE_CROSSCOMPILING_EMULATOR "/usr/bin/wine")' >> ${CMAKE_TOOLCHAIN_FILE}
|
||||
|
Loading…
Reference in New Issue
Block a user