From ce7da0b874784e6b69e3966b5d7ba995e873163e Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 10 Nov 2014 11:05:40 -0700 Subject: [PATCH] Remove the source (slimming us down by about 100MB) and skip the tests entirely (since they've been so flaky for us) --- 2.7/Dockerfile | 17 +++++++---------- 3.3/Dockerfile | 14 +++++++------- 3.4/Dockerfile | 16 +++++++--------- 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/2.7/Dockerfile b/2.7/Dockerfile index 6ede619..8804767 100644 --- a/2.7/Dockerfile +++ b/2.7/Dockerfile @@ -5,24 +5,21 @@ RUN apt-get update && apt-get install -y curl procps # remove several traces of debian python RUN apt-get purge -y python python-minimal python2.7-minimal -RUN mkdir /usr/src/python -WORKDIR /usr/src/python - # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 ENV PYTHON_VERSION 2.7.8 -RUN curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" \ - | tar -xJ --strip-components=1 -# skip "test_file2k" thanks to "AssertionError: IOError not raised" -# skip "test_mhlib" because it fails on the hub in "test_listfolders" with "AssertionError: Lists differ: [] != ['deep', 'deep/f1', 'deep/f2',..." -RUN ./configure \ +RUN mkdir -p /usr/src/python \ + && curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" \ + | tar -xJC /usr/src/python --strip-components=1 \ + && cd /usr/src/python \ + && ./configure \ && make -j$(nproc) \ - && make EXTRATESTOPTS='--exclude test_file2k test_mhlib' test \ && make install \ - && make clean + && cd / \ + && rm -rf /usr/src/python # install "pip" and "virtualenv", since the vast majority of users of this image will want it RUN curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python2 diff --git a/3.3/Dockerfile b/3.3/Dockerfile index 0f08cbe..73820e1 100644 --- a/3.3/Dockerfile +++ b/3.3/Dockerfile @@ -5,21 +5,21 @@ RUN apt-get update && apt-get install -y curl procps # remove several traces of debian python RUN apt-get purge -y python python-minimal python2.7-minimal -RUN mkdir /usr/src/python -WORKDIR /usr/src/python - # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 ENV PYTHON_VERSION 3.3.6 -RUN curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" \ - | tar -xJ --strip-components=1 -RUN ./configure \ +RUN mkdir -p /usr/src/python \ + && curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" \ + | tar -xJC /usr/src/python --strip-components=1 \ + && cd /usr/src/python \ + && ./configure \ && make -j$(nproc) \ && make install \ - && make clean + && cd / \ + && rm -rf /usr/src/python # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ diff --git a/3.4/Dockerfile b/3.4/Dockerfile index 417c4f3..56b9960 100644 --- a/3.4/Dockerfile +++ b/3.4/Dockerfile @@ -5,23 +5,21 @@ RUN apt-get update && apt-get install -y curl procps # remove several traces of debian python RUN apt-get purge -y python python-minimal python2.7-minimal -RUN mkdir /usr/src/python -WORKDIR /usr/src/python - # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 ENV PYTHON_VERSION 3.4.2 -RUN curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" \ - | tar -xJ --strip-components=1 -# skip "test_shutil" thanks to "PermissionError: [Errno 1] Operation not permitted" trying to set xattrs -RUN ./configure \ +RUN mkdir -p /usr/src/python \ + && curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" \ + | tar -xJC /usr/src/python --strip-components=1 \ + && cd /usr/src/python \ + && ./configure \ && make -j$(nproc) \ - && make -j$(nproc) EXTRATESTOPTS='--exclude test_shutil' test \ && make install \ - && make clean + && cd / \ + && rm -rf /usr/src/python # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \