From 26c5447d297a9f73e8a49254e45dc4a56556fcc2 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 3 Nov 2016 21:33:24 -0400 Subject: [PATCH 1/3] manylinux: Consolidate common content into common.manylinux --- Makefile | 8 ++++---- common.manylinux | 10 ++++++++++ manylinux-x64/Dockerfile.in | 11 +---------- manylinux-x86/Dockerfile.in | 11 +---------- 4 files changed, 16 insertions(+), 24 deletions(-) create mode 100644 common.manylinux diff --git a/Makefile b/Makefile index 9a9311a..9827b5d 100644 --- a/Makefile +++ b/Makefile @@ -56,8 +56,8 @@ browser-asmjs.test: browser-asmjs # # manylinux-x64 # -manylinux-x64/Dockerfile: manylinux-x64/Dockerfile.in common.docker - sed '/common.docker/ r common.docker' manylinux-x64/Dockerfile.in > manylinux-x64/Dockerfile +manylinux-x64/Dockerfile: manylinux-x64/Dockerfile.in common.docker common.manylinux + sed -e '/common.docker/ r common.docker' -e '/common.manylinux/ r common.manylinux' manylinux-x64/Dockerfile.in > manylinux-x64/Dockerfile manylinux-x64: manylinux-x64/Dockerfile $(DOCKER) build -t $(ORG)/manylinux-x64 \ @@ -74,8 +74,8 @@ manylinux-x64.test: manylinux-x64 # # manylinux-x86 # -manylinux-x86/Dockerfile: manylinux-x86/Dockerfile.in common.docker - sed '/common.docker/ r common.docker' manylinux-x86/Dockerfile.in > manylinux-x86/Dockerfile +manylinux-x86/Dockerfile: manylinux-x86/Dockerfile.in common.docker common.manylinux + sed -e '/common.docker/ r common.docker' -e '/common.manylinux/ r common.manylinux' manylinux-x86/Dockerfile.in > manylinux-x86/Dockerfile manylinux-x86: manylinux-x86/Dockerfile $(DOCKER) build -t $(ORG)/manylinux-x86 \ diff --git a/common.manylinux b/common.manylinux new file mode 100644 index 0000000..e7c57c1 --- /dev/null +++ b/common.manylinux @@ -0,0 +1,10 @@ +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-common/install-python-packages.sh /usr/local/bin +RUN /usr/local/bin/install-python-packages.sh + +RUN yum -y install sudo diff --git a/manylinux-x64/Dockerfile.in b/manylinux-x64/Dockerfile.in index 01a0e71..2f24c81 100644 --- a/manylinux-x64/Dockerfile.in +++ b/manylinux-x64/Dockerfile.in @@ -3,16 +3,7 @@ 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-common/install-python-packages.sh /usr/local/bin -RUN /usr/local/bin/install-python-packages.sh - -RUN yum -y install sudo +#include "common.manylinux" ENV CROSS_TRIPLE x86_64-linux-gnu ENV CROSS_ROOT /opt/rh/devtoolset-2/root/usr/bin diff --git a/manylinux-x86/Dockerfile.in b/manylinux-x86/Dockerfile.in index 7eacb85..0cc12e5 100644 --- a/manylinux-x86/Dockerfile.in +++ b/manylinux-x86/Dockerfile.in @@ -3,16 +3,7 @@ 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-common/install-python-packages.sh /usr/local/bin -RUN /usr/local/bin/install-python-packages.sh - -RUN yum -y install sudo +#include "common.manylinux" ENV CROSS_TRIPLE i686-linux-gnu ENV CROSS_ROOT /opt/rh/devtoolset-2/root/usr/bin From 53cf0849fe673bd6876c2b5295d7a8aabdbcf396 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 3 Nov 2016 14:12:12 -0400 Subject: [PATCH 2/3] manylinux: Do not require a tty for sudo This enabling installation of Python packages with on CI services. Issue #57 --- common.manylinux | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common.manylinux b/common.manylinux index e7c57c1..823754a 100644 --- a/common.manylinux +++ b/common.manylinux @@ -7,4 +7,6 @@ RUN cd /opt && \ COPY manylinux-common/install-python-packages.sh /usr/local/bin RUN /usr/local/bin/install-python-packages.sh -RUN yum -y install sudo +RUN yum -y install sudo && \ + sed -i 's/Defaults requiretty/#Defaults requiretty/' /etc/sudoers + From f3654d8dce15161841781bd73f9cf148977a730e Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 3 Nov 2016 21:37:50 -0400 Subject: [PATCH 3/3] manylinux: Run visudo -c Verify /etc/sudoers validity Tested-by: Jean-Christophe Fillion-Robin --- common.manylinux | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common.manylinux b/common.manylinux index 823754a..bd9664a 100644 --- a/common.manylinux +++ b/common.manylinux @@ -8,5 +8,6 @@ COPY manylinux-common/install-python-packages.sh /usr/local/bin RUN /usr/local/bin/install-python-packages.sh RUN yum -y install sudo && \ - sed -i 's/Defaults requiretty/#Defaults requiretty/' /etc/sudoers + sed -i 's/Defaults requiretty/#Defaults requiretty/' /etc/sudoers && \ + visudo -c