Merge pull request #31 from thewtex/manylinux

Add manylinux-x64
This commit is contained in:
Matt McCormick 2016-09-20 23:24:02 -04:00 committed by GitHub
commit abde0d6fd7
10 changed files with 143 additions and 78 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
bin bin
dockcross dockcross
*/test/ */test/
Dockerfile

View File

@ -1,78 +0,0 @@
FROM debian:jessie
MAINTAINER Matt McCormick "matt.mccormick@kitware.com"
# Insert this line before "RUN apt-get update" to dynamically
# replace httpredir.debian.org with a single working domain
# in attempt to "prevent" the "Error reading from server" error.
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 && \
apt-get -y clean
WORKDIR /usr/share
RUN git clone https://github.com/nojhan/liquidprompt.git && \
cd liquidprompt && \
git checkout v_1.11
COPY imagefiles/.bashrc /root/
# Build and install CMake from source.
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_USE_SYSTEM_CURL:BOOL=ON \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_USE_OPENSSL:BOOL=ON . && \
make install && \
cd .. && \
rm -rf CMake*
# Wrappers that point to CMAKE_TOOLCHAIN_FILE
# Build and install Ninja from source
RUN git clone https://github.com/martine/ninja.git && \
cd ninja && \
git checkout v1.7.1 && \
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
RUN echo "root:root" | chpasswd
WORKDIR /work
ENTRYPOINT ["/dockcross/entrypoint.sh"]
COPY imagefiles/entrypoint.sh imagefiles/dockcross /dockcross/

36
Dockerfile.in Normal file
View File

@ -0,0 +1,36 @@
FROM debian:jessie
MAINTAINER Matt McCormick "matt.mccormick@kitware.com"
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 && \
apt-get -y clean
#include "common.docker"

View File

@ -71,6 +71,16 @@ linux-ppc64le.test: linux-ppc64le test/run.py
$(DOCKER) run --rm dockcross/linux-ppc64le > $(BIN)/dockcross-linux-ppc64le && chmod +x $(BIN)/dockcross-linux-ppc64le $(DOCKER) run --rm dockcross/linux-ppc64le > $(BIN)/dockcross-linux-ppc64le && chmod +x $(BIN)/dockcross-linux-ppc64le
$(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
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 .
manylinux-x64.test: manylinux-x64 test/run.py
$(DOCKER) run --rm dockcross/manylinux-x64 > $(BIN)/dockcross-manylinux-x64 && chmod +x $(BIN)/dockcross-manylinux-x64
$(BIN)/dockcross-manylinux-x64 /opt/python/cp35-cp35m/bin/python test/run.py
windows-x86: base windows-x86/Dockerfile windows-x86/settings.mk windows-x86: base windows-x86/Dockerfile windows-x86/settings.mk
$(DOCKER) build -t $(ORG)/windows-x86 windows-x86 $(DOCKER) build -t $(ORG)/windows-x86 windows-x86
@ -85,6 +95,9 @@ windows-x64.test: windows-x64 test/run.py
$(DOCKER) run --rm dockcross/windows-x64 > $(BIN)/dockcross-windows-x64 && chmod +x $(BIN)/dockcross-windows-x64 $(DOCKER) run --rm dockcross/windows-x64 > $(BIN)/dockcross-windows-x64 && chmod +x $(BIN)/dockcross-windows-x64
$(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
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

@ -99,6 +99,14 @@ dockcross/linux-x86
|linux-x86-images| Linux i686 cross compiler. |linux-x86-images| Linux i686 cross compiler.
.. |manylinux-x64-images| image:: https://badge.imagelayers.io/dockcross/manylinux-x64:latest.svg
:target: https://imagelayers.io/?images=dockcross/manylinux-x64:latest
dockcross/manylinux-x64
|manylinux-x64-images| Docker `manylinux <https://github.com/pypa/manylinux>`_ image for building Linux x86_64 / amd64 `Python wheel packages <http://pythonwheels.com/>`_.
Also has support for the dockcross script, and it has installations of CMake, Ninja, and `scikit-build <http://scikit-build.org>`_
.. |windows-x64-images| image:: https://badge.imagelayers.io/dockcross/windows-x64:latest.svg .. |windows-x64-images| image:: https://badge.imagelayers.io/dockcross/windows-x64:latest.svg
:target: https://imagelayers.io/?images=dockcross/windows-x64:latest :target: https://imagelayers.io/?images=dockcross/windows-x64:latest

View File

@ -19,6 +19,7 @@ dependencies:
- docker pull dockcross/linux-ppc64le - docker pull dockcross/linux-ppc64le
- docker pull dockcross/linux-x64 - docker pull dockcross/linux-x64
- docker pull dockcross/linux-x86 - docker pull dockcross/linux-x86
- docker pull dockcross/manylinux-x64
- docker pull dockcross/windows-x64 - docker pull dockcross/windows-x64
- docker pull dockcross/windows-x86 - docker pull dockcross/windows-x86
@ -34,6 +35,7 @@ test:
- make linux-ppc64le.test - make linux-ppc64le.test
- make linux-x64.test - make linux-x64.test
- make linux-x86.test - make linux-x86.test
- make manylinux-x64.test
- make windows-x64.test: - make windows-x64.test:
timeout: 3000 timeout: 3000
- make windows-x86.test: - make windows-x86.test:
@ -54,5 +56,6 @@ deployment:
- docker push dockcross/linux-ppc64le - docker push dockcross/linux-ppc64le
- docker push dockcross/linux-x64 - docker push dockcross/linux-x64
- docker push dockcross/linux-x86 - docker push dockcross/linux-x86
- docker push dockcross/manylinux-x64
- docker push dockcross/windows-x64 - docker push dockcross/windows-x64
- docker push dockcross/windows-x86 - docker push dockcross/windows-x86

37
common.docker Normal file
View File

@ -0,0 +1,37 @@
WORKDIR /usr/share
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 .. && \
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/ && \
cd .. && rm -rf ninja
COPY imagefiles/cmake.sh /usr/local/bin/cmake
COPY imagefiles/ccmake.sh /usr/local/bin/ccmake
RUN echo "root:root" | chpasswd
WORKDIR /work
ENTRYPOINT ["/dockcross/entrypoint.sh"]
COPY imagefiles/entrypoint.sh imagefiles/dockcross /dockcross/

View File

@ -0,0 +1,28 @@
FROM quay.io/pypa/manylinux1_x86_64:latest
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 && \
./package/install
COPY manylinux-x64/install-skbuild.sh /usr/local/bin
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++ \
LD=${CROSS_ROOT}/ld
COPY linux-x64/${CROSS_TRIPLE}-noop.sh /usr/bin/${CROSS_TRIPLE}-noop
COPY manylinux-x64/Toolchain.cmake ${CROSS_ROOT}/../lib/
ENV CMAKE_TOOLCHAIN_FILE ${CROSS_ROOT}/../lib/Toolchain.cmake
ENV DEFAULT_DOCKCROSS_IMAGE dockcross/manylinux-x64

View File

@ -0,0 +1,12 @@
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
set(cross_triple "x86_64-linux-gnu")
set(CMAKE_C_COMPILER /opt/rh/devtoolset-2/root/usr/bin/gcc)
set(CMAKE_CXX_COMPILER /opt/rh/devtoolset-2/root/usr/bin/g++)
set(CMAKE_ASM_COMPILER /opt/rh/devtoolset-2/root/usr/bin/as)
set(CMAKE_Fortran_COMPILER /opt/rh/devtoolset-2/root/usr/bin/gfortran)
set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/${cross_triple}-noop)

View File

@ -0,0 +1,5 @@
#!/bin/bash
for PIP in /opt/python/*/bin/pip; do
$PIP install scikit-build==0.3.0
done