-
Notifications
You must be signed in to change notification settings - Fork 46
Bring up to equivalent quality as Python images #10
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
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
deadee9
Ensure local pypy is preferred over distribution python
JayH5 0af29ac
Install pip like we do for the python images
JayH5 88d10f0
Fetch PyPy using wget and install fetch deps using variable
JayH5 f61a497
Install libffi in the slim images
JayH5 fbfab37
Add tcl and tk as runtime dependencies to non-slim images for tkinter
JayH5 72cec48
Check the PyPy download's SHA256SUM
JayH5 9a39963
Add command to fetch SHA256 checksum to update.sh
JayH5 8a1c5f0
Merge branch 'master' into python-equality
JayH5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,41 @@ | ||
FROM buildpack-deps:jessie | ||
|
||
# remove several traces of debian python | ||
RUN apt-get purge -y python.* | ||
# ensure local pypy is preferred over distribution python | ||
ENV PATH /usr/local/bin:$PATH | ||
|
||
# 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 PYPY_VERSION 5.4.1 | ||
# runtime dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
tcl \ | ||
tk \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN set -x \ | ||
&& curl -SL "https://bitbucket.org/pypy/pypy/downloads/pypy2-v${PYPY_VERSION}-linux64.tar.bz2" \ | ||
| tar -xjC /usr/local --strip-components=1 | ||
ENV PYPY_VERSION 5.4.1 | ||
ENV PYPY_SHA256SUM 9c85319778224d7fb0c348f55fe3fada15bb579c5f3870a13ad63b42a737dd72 | ||
|
||
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" | ||
ENV PYTHON_PIP_VERSION 8.1.2 | ||
RUN curl -SL 'https://bootstrap.pypa.io/get-pip.py' | pypy \ | ||
&& pip install --upgrade pip==$PYTHON_PIP_VERSION | ||
|
||
RUN set -ex \ | ||
&& wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy2-v${PYPY_VERSION}-linux64.tar.bz2" \ | ||
&& echo "$PYPY_SHA256SUM pypy.tar.bz2" | sha256sum -c \ | ||
&& tar -xjC /usr/local --strip-components=1 -f pypy.tar.bz2 \ | ||
&& rm pypy.tar.bz2 \ | ||
\ | ||
&& wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ | ||
&& pypy /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ | ||
&& rm /tmp/get-pip.py \ | ||
# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python | ||
# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") | ||
# https://github.com/docker-library/python/pull/143#issuecomment-241032683 | ||
&& pip install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ | ||
# then we use "pip list" to ensure we don't have more than one pip version installed | ||
# https://github.com/docker-library/python/pull/100 | ||
&& [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ | ||
\ | ||
&& rm -rf ~/.cache | ||
|
||
CMD ["pypy"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,44 @@ | ||
FROM buildpack-deps:jessie | ||
|
||
# remove several traces of debian python | ||
RUN apt-get purge -y python.* | ||
# ensure local pypy is preferred over distribution python | ||
ENV PATH /usr/local/bin:$PATH | ||
|
||
# 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 PYPY_VERSION 5.2.0-alpha1 | ||
# runtime dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
tcl \ | ||
tk \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN set -x \ | ||
&& curl -SL "https://bitbucket.org/pypy/pypy/downloads/pypy3.3-v${PYPY_VERSION}-linux64.tar.bz2" \ | ||
| tar -xjC /usr/local --strip-components=1 | ||
ENV PYPY_VERSION 5.2.0-alpha1 | ||
ENV PYPY_SHA256SUM f5e66ab24267d6ddf662d07c512d06c10ebc732ae62093dabbd775ac63b9060a | ||
|
||
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" | ||
ENV PYTHON_PIP_VERSION 8.1.2 | ||
RUN curl -SL 'https://bootstrap.pypa.io/get-pip.py' | pypy3 \ | ||
&& pip install --upgrade pip==$PYTHON_PIP_VERSION | ||
|
||
RUN set -ex \ | ||
&& wget -O pypy.tar.bz2 "https://bitbucket.org/pypy/pypy/downloads/pypy3.3-v${PYPY_VERSION}-linux64.tar.bz2" \ | ||
&& echo "$PYPY_SHA256SUM pypy.tar.bz2" | sha256sum -c \ | ||
&& tar -xjC /usr/local --strip-components=1 -f pypy.tar.bz2 \ | ||
&& rm pypy.tar.bz2 \ | ||
\ | ||
# explicit path to "pip3" to ensure distribution-provided "pip3" cannot interfere | ||
&& if [ ! -e /usr/local/bin/pip3 ]; then : \ | ||
&& wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ | ||
&& pypy3 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \ | ||
&& rm /tmp/get-pip.py \ | ||
; fi \ | ||
# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python | ||
# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages") | ||
# https://github.com/docker-library/python/pull/143#issuecomment-241032683 | ||
&& pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \ | ||
# then we use "pip list" to ensure we don't have more than one pip version installed | ||
# https://github.com/docker-library/python/pull/100 | ||
&& [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ] \ | ||
\ | ||
&& rm -rf ~/.cache | ||
|
||
CMD ["pypy3"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I'm not installing these in the slim images, as the same is not done in the Python slim images.
You can check for the necessary libraries doing something like:
On the non-slim Python/PyPy images this returns nothing. On the slim PyPy images this returns:
On the slim Python images it returns:
Not sure if missing gdbm is an issue...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could open a new issue to research the missing
libgdbm
to see if it is a problem. It is missing from the current slim images as well, so it is unrelated to your changes.