base,manylinux-x64: Use sed for Dockerfile composition

Suggested-by: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
This commit is contained in:
Matt McCormick 2016-09-20 13:17:15 -04:00
parent ed2ae68b7b
commit b596ca6cd8
4 changed files with 60 additions and 64 deletions

View File

@ -1,36 +1,36 @@
FROM debian:jessie FROM debian:jessie
MAINTAINER Matt McCormick "matt.mccormick@kitware.com" MAINTAINER Matt McCormick "matt.mccormick@kitware.com"
RUN apt-get update && apt-get install -y curl && \\ RUN apt-get update && apt-get install -y curl && \
sed -i "s/httpredir.debian.org/`curl -s -D - http://httpredir.debian.org/demo/debian/ | awk '/^Link:/ { print $2 }' | sed -e 's@<http://\(.*\)/debian/>;@\1@g'`/" /etc/apt/sources.list sed -i "s/httpredir.debian.org/`curl -s -D - http://httpredir.debian.org/demo/debian/ | awk '/^Link:/ { print $2 }' | sed -e 's@<http://\(.*\)/debian/>;@\1@g'`/" /etc/apt/sources.list
RUN apt-get update && apt-get -y install \\ RUN apt-get update && apt-get -y install \
automake \\ automake \
autogen \\ autogen \
bash \\ bash \
build-essential \\ build-essential \
bzip2 \\ bzip2 \
ca-certificates \\ ca-certificates \
curl \\ curl \
file \\ file \
git \\ git \
gzip \\ gzip \
libcurl4-openssl-dev \\ libcurl4-openssl-dev \
libssl-dev \\ libssl-dev \
make \\ make \
ncurses-dev \\ ncurses-dev \
pkg-config \\ pkg-config \
libtool \\ libtool \
python \\ python \
rsync \\ rsync \
sed \\ sed \
bison \\ bison \
flex \\ flex \
tar \\ tar \
vim \\ vim \
wget \\ wget \
runit \\ runit \
xz-utils && \\ xz-utils && \
apt-get -y clean apt-get -y clean
#include "common.docker" #include "common.docker"

View File

@ -72,7 +72,7 @@ linux-ppc64le.test: linux-ppc64le test/run.py
$(BIN)/dockcross-linux-ppc64le python test/run.py --languages C $(BIN)/dockcross-linux-ppc64le python test/run.py --languages C
manylinux-x64/Dockerfile: manylinux-x64/Dockerfile.in common.docker manylinux-x64/Dockerfile: manylinux-x64/Dockerfile.in common.docker
cpp -o manylinux-x64/Dockerfile -I$(shell pwd) manylinux-x64/Dockerfile.in sed '/common.docker/ r common.docker' manylinux-x64/Dockerfile.in > manylinux-x64/Dockerfile
manylinux-x64: manylinux-x64/Dockerfile manylinux-x64: manylinux-x64/Dockerfile
$(DOCKER) build -t $(ORG)/manylinux-x64 -f manylinux-x64/Dockerfile . $(DOCKER) build -t $(ORG)/manylinux-x64 -f manylinux-x64/Dockerfile .
@ -96,7 +96,7 @@ windows-x64.test: windows-x64 test/run.py
$(BIN)/dockcross-windows-x64 python test/run.py --exe-suffix ".exe" $(BIN)/dockcross-windows-x64 python test/run.py --exe-suffix ".exe"
Dockerfile: Dockerfile.in common.docker Dockerfile: Dockerfile.in common.docker
cpp -o Dockerfile Dockerfile.in sed '/common.docker/ r common.docker' Dockerfile.in > Dockerfile
base: Dockerfile base: Dockerfile
$(DOCKER) build -t $(ORG)/base . $(DOCKER) build -t $(ORG)/base .

View File

@ -1,35 +1,31 @@
#ifdef linux
#undef linux
#endif
WORKDIR /usr/share WORKDIR /usr/share
RUN git clone "https://github.com/nojhan/liquidprompt.git" && \\ RUN git clone "https://github.com/nojhan/liquidprompt.git" && \
cd liquidprompt && \\ cd liquidprompt && \
git checkout v_1.11 git checkout v_1.11
COPY imagefiles/.bashrc /root/ COPY imagefiles/.bashrc /root/
WORKDIR /usr/src WORKDIR /usr/src
RUN git clone "git://cmake.org/cmake.git" CMake && \\ RUN git clone "git://cmake.org/cmake.git" CMake && \
cd CMake && \\ cd CMake && \
git checkout v3.6.1 && \\ git checkout v3.6.1 && \
cd .. && mkdir CMake-build && cd CMake-build && \\ cd .. && mkdir CMake-build && cd CMake-build && \
/usr/src/CMake/bootstrap \\ /usr/src/CMake/bootstrap \
--parallel=$(nproc) \\ --parallel=$(nproc) \
--prefix=/usr && \\ --prefix=/usr && \
make -j$(nproc) && \\ make -j$(nproc) && \
./bin/cmake \\ ./bin/cmake \
-DCMAKE_BUILD_TYPE:STRING=Release \\ -DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_USE_OPENSSL:BOOL=ON . && \\ -DCMAKE_USE_OPENSSL:BOOL=ON . && \
make install && \\ make install && \
cd .. && \\ cd .. && \
rm -rf CMake* rm -rf CMake*
RUN git clone "https://github.com/martine/ninja.git" && \\ RUN git clone "https://github.com/martine/ninja.git" && \
cd ninja && \\ cd ninja && \
git checkout v1.7.1 && \\ git checkout v1.7.1 && \
([ -e /opt/python/cp35-cp35m/bin/python ] && /opt/python/cp35-cp35m/bin/python ./configure.py --bootstrap) || python ./configure.py --bootstrap && \\ ([ -e /opt/python/cp35-cp35m/bin/python ] && /opt/python/cp35-cp35m/bin/python ./configure.py --bootstrap) || python ./configure.py --bootstrap && \
./ninja && \\ ./ninja && \
cp ./ninja /usr/bin/ && \\ cp ./ninja /usr/bin/ && \
cd .. && rm -rf ninja cd .. && rm -rf ninja
COPY imagefiles/cmake.sh /usr/local/bin/cmake COPY imagefiles/cmake.sh /usr/local/bin/cmake
COPY imagefiles/ccmake.sh /usr/local/bin/ccmake COPY imagefiles/ccmake.sh /usr/local/bin/ccmake

View File

@ -3,10 +3,10 @@ MAINTAINER Matt McCormick "matt.mccormick@kitware.com"
#include "common.docker" #include "common.docker"
RUN cd /opt && \\ RUN cd /opt && \
wget "http://smarden.org/runit/runit-2.1.2.tar.gz" && \\ wget "http://smarden.org/runit/runit-2.1.2.tar.gz" && \
tar xvzf runit-2.1.2.tar.gz && \\ tar xvzf runit-2.1.2.tar.gz && \
cd admin/runit-2.1.2 && \\ cd admin/runit-2.1.2 && \
./package/install ./package/install
COPY manylinux-x64/install-skbuild.sh /usr/local/bin COPY manylinux-x64/install-skbuild.sh /usr/local/bin
@ -14,11 +14,11 @@ RUN /usr/local/bin/install-skbuild.sh
ENV CROSS_TRIPLE x86_64-linux-gnu ENV CROSS_TRIPLE x86_64-linux-gnu
ENV CROSS_ROOT /opt/rh/devtoolset-2/root/usr/bin ENV CROSS_ROOT /opt/rh/devtoolset-2/root/usr/bin
ENV AS=${CROSS_ROOT}/as \\ ENV AS=${CROSS_ROOT}/as \
AR=${CROSS_ROOT}/ar \\ AR=${CROSS_ROOT}/ar \
CC=${CROSS_ROOT}/gcc \\ CC=${CROSS_ROOT}/gcc \
CPP=${CROSS_ROOT}/cpp \\ CPP=${CROSS_ROOT}/cpp \
CXX=${CROSS_ROOT}/g++ \\ CXX=${CROSS_ROOT}/g++ \
LD=${CROSS_ROOT}/ld LD=${CROSS_ROOT}/ld
COPY linux-x64/${CROSS_TRIPLE}-noop.sh /usr/bin/${CROSS_TRIPLE}-noop COPY linux-x64/${CROSS_TRIPLE}-noop.sh /usr/bin/${CROSS_TRIPLE}-noop