Skip to content

Add slim variants #24

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
36 changes: 36 additions & 0 deletions 2.7/slim/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM debian:jessie

# remove several traces of debian python
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

RUN apt-get update && apt-get install -y ca-certificates libssl1.0.0 --no-install-recommends && rm -rf /var/lib/apt/lists/*

ENV PYTHON_VERSION 2.7.8

RUN set -x \
&& buildDeps='curl gcc libc6-dev libssl-dev make xz-utils zlib1g-dev' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& 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 --enable-shared \
&& make -j$(nproc) \
&& make install \
&& 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 '{}' + \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -rf /usr/src/python

# install "virtualenv", since the vast majority of users of this image will want it
RUN pip install virtualenv

CMD ["python2"]
40 changes: 40 additions & 0 deletions 3.3/slim/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM debian:jessie

# remove several traces of debian python
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

RUN apt-get update && apt-get install -y ca-certificates libssl1.0.0 --no-install-recommends && rm -rf /var/lib/apt/lists/*

ENV PYTHON_VERSION 3.3.6

RUN set -x \
&& buildDeps='curl gcc libc6-dev libssl-dev make xz-utils zlib1g-dev' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& 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 --enable-shared \
&& make -j$(nproc) \
&& make install \
&& 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 '{}' + \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -rf /usr/src/python

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

CMD ["python3"]
41 changes: 41 additions & 0 deletions 3.4/slim/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM debian:jessie

# remove several traces of debian python
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

RUN apt-get update && apt-get install -y ca-certificates libssl1.0.0 --no-install-recommends && rm -rf /var/lib/apt/lists/*

ENV PYTHON_VERSION 3.4.2

RUN set -x \
&& buildDeps='curl gcc libc6-dev libssl-dev make xz-utils zlib1g-dev' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& 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 --enable-shared \
&& make -j$(nproc) \
&& make install \
&& ldconfig \
&& find /usr/local \
\( -type d -a -name test -o -name tests \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
&& apt-get purge -y --auto-remove $buildDeps \
&& 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 pip3 pip \
&& ln -s pydoc3 pydoc \
&& ln -s python3 python \
&& ln -s python-config3 python-config

CMD ["python3"]
2 changes: 1 addition & 1 deletion generate-stackbrew-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ for version in "${versions[@]}"; do
echo "$va: ${url}@${commit} $version"
done

for variant in onbuild; do
for variant in onbuild slim; do
commit="$(git log -1 --format='format:%H' -- "$version/$variant")"
echo
for va in "${versionAliases[@]}"; do
Expand Down
2 changes: 1 addition & 1 deletion update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ for version in "${versions[@]}"; do
fullVersion="$(curl -sSL 'https://www.python.org/downloads/' | awk -F 'Python |</a>' '/<span class="release-number"><a[^>]+>Python '"$version"'./ { print $2 }' | sort -V | tail -1)"
(
set -x
sed -ri 's/^(ENV PYTHON_VERSION) .*/\1 '"$fullVersion"'/' "$version/Dockerfile"
sed -ri 's/^(ENV PYTHON_VERSION) .*/\1 '"$fullVersion"'/' "$version/Dockerfile" "$version/slim/Dockerfile"
sed -ri 's/^(FROM python):.*/\1:'"$fullVersion"'/' "$version/onbuild/Dockerfile"
)
done