Add `--enable-shared`, slightly smaller images, and slightly better consistency across Dockerfiles
This commit is contained in:
parent
be49cab808
commit
4faf7f1b13
|
@ -1,9 +1,7 @@
|
||||||
FROM buildpack-deps
|
FROM buildpack-deps:jessie
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y curl procps
|
|
||||||
|
|
||||||
# remove several traces of debian python
|
# remove several traces of debian python
|
||||||
RUN apt-get purge -y python python-minimal python2.7-minimal
|
RUN apt-get purge -y python.*
|
||||||
|
|
||||||
# http://bugs.python.org/issue19846
|
# http://bugs.python.org/issue19846
|
||||||
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
|
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
|
||||||
|
@ -11,18 +9,23 @@ ENV LANG C.UTF-8
|
||||||
|
|
||||||
ENV PYTHON_VERSION 2.7.8
|
ENV PYTHON_VERSION 2.7.8
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/python \
|
RUN set -x \
|
||||||
|
&& mkdir -p /usr/src/python \
|
||||||
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" \
|
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" \
|
||||||
| tar -xJC /usr/src/python --strip-components=1 \
|
| tar -xJC /usr/src/python --strip-components=1 \
|
||||||
&& cd /usr/src/python \
|
&& cd /usr/src/python \
|
||||||
&& ./configure \
|
&& ./configure --enable-shared \
|
||||||
&& make -j$(nproc) \
|
&& make -j$(nproc) \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& cd / \
|
&& ldconfig \
|
||||||
|
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python2 \
|
||||||
|
&& find /usr/local \
|
||||||
|
\( -type d -a -name test -o -name tests \) \
|
||||||
|
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
|
||||||
|
-exec rm -rf '{}' + \
|
||||||
&& rm -rf /usr/src/python
|
&& rm -rf /usr/src/python
|
||||||
|
|
||||||
# install "pip" and "virtualenv", since the vast majority of users of this image will want it
|
# install "virtualenv", since the vast majority of users of this image will want it
|
||||||
RUN curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python2
|
|
||||||
RUN pip install virtualenv
|
RUN pip install virtualenv
|
||||||
|
|
||||||
CMD ["python2"]
|
CMD ["python2"]
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
FROM buildpack-deps
|
FROM buildpack-deps:jessie
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y curl procps
|
|
||||||
|
|
||||||
# remove several traces of debian python
|
# remove several traces of debian python
|
||||||
RUN apt-get purge -y python python-minimal python2.7-minimal
|
RUN apt-get purge -y python.*
|
||||||
|
|
||||||
# http://bugs.python.org/issue19846
|
# http://bugs.python.org/issue19846
|
||||||
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
|
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
|
||||||
|
@ -11,24 +9,27 @@ ENV LANG C.UTF-8
|
||||||
|
|
||||||
ENV PYTHON_VERSION 3.3.6
|
ENV PYTHON_VERSION 3.3.6
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/python \
|
RUN set -x \
|
||||||
|
&& mkdir -p /usr/src/python \
|
||||||
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" \
|
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" \
|
||||||
| tar -xJC /usr/src/python --strip-components=1 \
|
| tar -xJC /usr/src/python --strip-components=1 \
|
||||||
&& cd /usr/src/python \
|
&& cd /usr/src/python \
|
||||||
&& ./configure \
|
&& ./configure --enable-shared \
|
||||||
&& make -j$(nproc) \
|
&& make -j$(nproc) \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& cd / \
|
&& ldconfig \
|
||||||
|
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python3 \
|
||||||
|
&& find /usr/local \
|
||||||
|
\( -type d -a -name test -o -name tests \) \
|
||||||
|
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
|
||||||
|
-exec rm -rf '{}' + \
|
||||||
&& rm -rf /usr/src/python
|
&& rm -rf /usr/src/python
|
||||||
|
|
||||||
# make some useful symlinks that are expected to exist
|
# make some useful symlinks that are expected to exist
|
||||||
RUN cd /usr/local/bin \
|
RUN cd /usr/local/bin \
|
||||||
&& ln -s easy_install-3.4 easy_install \
|
|
||||||
&& ln -s idle3 idle \
|
&& ln -s idle3 idle \
|
||||||
&& ln -s pydoc3 pydoc \
|
&& ln -s pydoc3 pydoc \
|
||||||
&& ln -s python3 python \
|
&& ln -s python3 python \
|
||||||
&& ln -s python-config3 python-config
|
&& ln -s python-config3 python-config
|
||||||
|
|
||||||
RUN curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python3
|
|
||||||
|
|
||||||
CMD ["python3"]
|
CMD ["python3"]
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
FROM buildpack-deps
|
FROM buildpack-deps:jessie
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y curl procps
|
|
||||||
|
|
||||||
# remove several traces of debian python
|
# remove several traces of debian python
|
||||||
RUN apt-get purge -y python python-minimal python2.7-minimal
|
RUN apt-get purge -y python.*
|
||||||
|
|
||||||
# http://bugs.python.org/issue19846
|
# http://bugs.python.org/issue19846
|
||||||
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
|
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
|
||||||
|
@ -11,14 +9,19 @@ ENV LANG C.UTF-8
|
||||||
|
|
||||||
ENV PYTHON_VERSION 3.4.2
|
ENV PYTHON_VERSION 3.4.2
|
||||||
|
|
||||||
RUN mkdir -p /usr/src/python \
|
RUN set -x \
|
||||||
|
&& mkdir -p /usr/src/python \
|
||||||
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" \
|
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" \
|
||||||
| tar -xJC /usr/src/python --strip-components=1 \
|
| tar -xJC /usr/src/python --strip-components=1 \
|
||||||
&& cd /usr/src/python \
|
&& cd /usr/src/python \
|
||||||
&& ./configure \
|
&& ./configure --enable-shared \
|
||||||
&& make -j$(nproc) \
|
&& make -j$(nproc) \
|
||||||
&& make install \
|
&& make install \
|
||||||
&& cd / \
|
&& ldconfig \
|
||||||
|
&& find /usr/local \
|
||||||
|
\( -type d -a -name test -o -name tests \) \
|
||||||
|
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
|
||||||
|
-exec rm -rf '{}' + \
|
||||||
&& rm -rf /usr/src/python
|
&& rm -rf /usr/src/python
|
||||||
|
|
||||||
# make some useful symlinks that are expected to exist
|
# make some useful symlinks that are expected to exist
|
||||||
|
|
Loading…
Reference in New Issue