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
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
RUN apt-get update && apt-get -y install \\
automake \\
autogen \\
bash \\
build-essential \\
bzip2 \\
ca-certificates \\
curl \\
file \\
git \\
gzip \\
libcurl4-openssl-dev \\
libssl-dev \\
make \\
ncurses-dev \\
pkg-config \\
libtool \\
python \\
rsync \\
sed \\
bison \\
flex \\
tar \\
vim \\
wget \\
runit \\
xz-utils && \\
RUN apt-get update && apt-get -y install \
automake \
autogen \
bash \
build-essential \
bzip2 \
ca-certificates \
curl \
file \
git \
gzip \
libcurl4-openssl-dev \
libssl-dev \
make \
ncurses-dev \
pkg-config \
libtool \
python \
rsync \
sed \
bison \
flex \
tar \
vim \
wget \
runit \
xz-utils && \
apt-get -y clean
#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
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
$(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"
Dockerfile: Dockerfile.in common.docker
cpp -o Dockerfile Dockerfile.in
sed '/common.docker/ r common.docker' Dockerfile.in > Dockerfile
base: Dockerfile
$(DOCKER) build -t $(ORG)/base .

View File

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

View File

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