From 5f5a89071445d3b1aa37e2d3376f42f0f5808769 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 6 Jun 2018 20:17:10 -0400 Subject: [PATCH] common.*: Clearly differentiate runtime and buildtime scripts Simplify all common.* files by simply removing the "buildscripts" directory instead of listing each script one by one. --- common.debian | 7 ++++--- common.docker | 44 ++++++++++++++++++-------------------------- common.manylinux | 13 +++++++------ 3 files changed, 29 insertions(+), 35 deletions(-) diff --git a/common.debian b/common.debian index e5ef789..4f91915 100644 --- a/common.debian +++ b/common.debian @@ -1,7 +1,8 @@ RUN REPO=http://cdn-fastly.deb.debian.org && \ echo "deb $REPO/debian jessie main\ndeb $REPO/debian jessie-updates main\ndeb $REPO/debian-security jessie/updates main" > /etc/apt/sources.list -COPY imagefiles/install-gosu-binary.sh /dockcross/ +# Image build scripts +COPY imagefiles/install-gosu-binary.sh /buildscripts/ ARG DEBIAN_FRONTEND=noninteractive @@ -39,6 +40,6 @@ RUN \ zlib1g-dev \ && \ apt-get clean --yes && \ - /dockcross/install-gosu-binary.sh && \ - rm /dockcross/install-gosu-binary.sh + /buildscripts/install-gosu-binary.sh && \ + rm -rf /buildscripts diff --git a/common.docker b/common.docker index c18c5a2..018189f 100644 --- a/common.docker +++ b/common.docker @@ -3,6 +3,7 @@ WORKDIR /usr/src ARG GIT_VERSION=2.16.2 ARG CMAKE_VERSION=3.11.0 +# Image build scripts COPY \ imagefiles/build-and-install-git.sh \ imagefiles/utils.sh \ @@ -13,41 +14,29 @@ COPY \ imagefiles/install-liquidprompt-binary.sh \ imagefiles/build-and-install-curl.sh \ imagefiles/build-and-install-ninja.sh \ - /dockcross/ + /buildscripts/ RUN \ if [ "$DEFAULT_DOCKCROSS_IMAGE" = "dockcross/manylinux-x86" ]; then \ - /dockcross/build-and-install-openssl.sh -32 && \ - /dockcross/build-and-install-openssh.sh && \ - /dockcross/build-and-install-curl.sh && \ - /dockcross/build-and-install-git.sh && \ - /dockcross/build-and-install-cmake.sh -32 || exit 1; \ + /buildscripts/build-and-install-openssl.sh -32 && \ + /buildscripts/build-and-install-openssh.sh && \ + /buildscripts/build-and-install-curl.sh && \ + /buildscripts/build-and-install-git.sh && \ + /buildscripts/build-and-install-cmake.sh -32 || exit 1; \ else \ - /dockcross/build-and-install-openssl.sh && \ - /dockcross/build-and-install-openssh.sh && \ - /dockcross/build-and-install-curl.sh && \ - /dockcross/build-and-install-git.sh && \ - /dockcross/install-cmake-binary.sh || exit 1; \ + /buildscripts/build-and-install-openssl.sh && \ + /buildscripts/build-and-install-openssh.sh && \ + /buildscripts/build-and-install-curl.sh && \ + /buildscripts/build-and-install-git.sh && \ + /buildscripts/install-cmake-binary.sh || exit 1; \ fi; \ - /dockcross/install-liquidprompt-binary.sh && \ + /buildscripts/install-liquidprompt-binary.sh && \ PYTHON=$([ -e /opt/python/cp35-cp35m/bin/python ] && echo "/opt/python/cp35-cp35m/bin/python" || echo "python") && \ - /dockcross/build-and-install-ninja.sh -python ${PYTHON} && \ - rm \ - /dockcross/build-and-install-git.sh \ - /dockcross/utils.sh \ - /dockcross/build-and-install-openssl.sh \ - /dockcross/build-and-install-openssh.sh \ - /dockcross/build-and-install-cmake.sh \ - /dockcross/install-cmake-binary.sh \ - /dockcross/install-liquidprompt-binary.sh \ - /dockcross/build-and-install-curl.sh \ - /dockcross/build-and-install-ninja.sh \ + /buildscripts/build-and-install-ninja.sh -python ${PYTHON} && \ + rm -rf /buildscripts \ && \ ${PYTHON} -m pip install --ignore-installed conan -COPY imagefiles/cmake.sh /usr/local/bin/cmake -COPY imagefiles/ccmake.sh /usr/local/bin/ccmake - RUN if [ -e /opt/python/cp35-cp35m/bin/python ]; then \ : nothing to do here since it is updated by manylinux-common/install-python-packages.sh ; \ else \ @@ -60,4 +49,7 @@ RUN echo "root:root" | chpasswd WORKDIR /work ENTRYPOINT ["/dockcross/entrypoint.sh"] +# Runtime scripts +COPY imagefiles/cmake.sh /usr/local/bin/cmake +COPY imagefiles/ccmake.sh /usr/local/bin/ccmake COPY imagefiles/entrypoint.sh imagefiles/dockcross /dockcross/ diff --git a/common.manylinux b/common.manylinux index b8f0de8..011b51a 100644 --- a/common.manylinux +++ b/common.manylinux @@ -1,8 +1,8 @@ +# Image build scripts COPY \ imagefiles/install-gosu-binary.sh \ manylinux-common/install-python-packages.sh \ - manylinux-common/pre_exec.sh \ - /dockcross/ + /buildscripts/ RUN \ set -x && \ @@ -16,11 +16,12 @@ RUN \ zip \ && \ yum clean all && \ - /dockcross/install-gosu-binary.sh && \ - rm /dockcross/install-gosu-binary.sh && \ + /buildscripts/install-gosu-binary.sh && \ # Remove sudo provided by "devtoolset-2" since it doesn't work with # our sudo wrapper calling gosu. rm /opt/rh/devtoolset-2/root/usr/bin/sudo && \ - /dockcross/install-python-packages.sh && \ - rm /dockcross/install-python-packages.sh + /buildscripts/install-python-packages.sh && \ + rm -rf /buildscripts +# Runtime scripts +COPY manylinux-common/pre_exec.sh /dockcross/