Skip to content

Add --enable-shared, slightly smaller images, and slightly better consistency across Dockerfiles #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions 2.7/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
FROM buildpack-deps

RUN apt-get update && apt-get install -y curl procps
FROM buildpack-deps:jessie

# 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
# > 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 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" \
| tar -xJC /usr/src/python --strip-components=1 \
&& cd /usr/src/python \
&& ./configure \
&& ./configure --enable-shared \
&& make -j$(nproc) \
&& 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

# 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
# install "virtualenv", since the vast majority of users of this image will want it
RUN pip install virtualenv

CMD ["python2"]
21 changes: 11 additions & 10 deletions 3.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
FROM buildpack-deps

RUN apt-get update && apt-get install -y curl procps
FROM buildpack-deps:jessie

# 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
# > 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 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" \
| tar -xJC /usr/src/python --strip-components=1 \
&& cd /usr/src/python \
&& ./configure \
&& ./configure --enable-shared \
&& make -j$(nproc) \
&& 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

# make some useful symlinks that are expected to exist
RUN cd /usr/local/bin \
&& ln -s easy_install-3.4 easy_install \
&& ln -s idle3 idle \
&& ln -s pydoc3 pydoc \
&& ln -s python3 python \
&& ln -s python-config3 python-config

RUN curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python3

CMD ["python3"]
17 changes: 10 additions & 7 deletions 3.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
FROM buildpack-deps

RUN apt-get update && apt-get install -y curl procps
FROM buildpack-deps:jessie

# 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
# > 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 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" \
| tar -xJC /usr/src/python --strip-components=1 \
&& cd /usr/src/python \
&& ./configure \
&& ./configure --enable-shared \
&& make -j$(nproc) \
&& 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

# make some useful symlinks that are expected to exist
Expand Down