-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Adjust alpine and standard variants to be closer in sync #81
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
Conversation
Noticed these (especially the missing My general thought here is that we should settle on a final "acceptable diff" for the 3.5 alpine variant first, and then replicate across. 👍 |
2fced0e
to
30d1c63
Compare
More relevant diffs: $ git diff --no-index 2.7/slim/Dockerfile 2.7/alpine/Dockerfile
diff --git a/2.7/slim/Dockerfile b/2.7/alpine/Dockerfile
index 2eede36..0d155a6 100644
--- a/2.7/slim/Dockerfile
+++ b/2.7/alpine/Dockerfile
@@ -1,18 +1,9 @@
-FROM debian:jessie
-
-# remove several traces of debian python
-RUN apt-get purge -y python.*
+FROM alpine:3.3
# 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 --no-install-recommends \
- ca-certificates \
- libsqlite3-0 \
- libssl1.0.0 \
- && rm -rf /var/lib/apt/lists/*
-
# gpg: key 18ADD4FF: public key "Benjamin Peterson <benjamin@python.org>" imported
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
@@ -22,41 +13,49 @@ ENV PYTHON_VERSION 2.7.11
ENV PYTHON_PIP_VERSION 7.1.2
RUN set -ex \
- && buildDeps=' \
- curl \
- gcc \
- libbz2-dev \
- libc6-dev \
- libncurses-dev \
- libreadline-dev \
- libsqlite3-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/* \
+ && apk add --no-cache --virtual .fetch-deps curl gnupg \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
&& gpg --verify python.tar.xz.asc \
- && mkdir -p /usr/src/python \
- && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
+ && mkdir -p /usr/src \
+ && tar -xJC /usr/src -f python.tar.xz \
+ && mv "/usr/src/Python-$PYTHON_VERSION" /usr/src/python \
&& rm python.tar.xz* \
&& rm -r ~/.gnupg \
\
+ && apk add --no-cache --virtual .build-deps \
+ bzip2-dev \
+ gcc \
+ libc-dev \
+ linux-headers \
+ make \
+ ncurses-dev \
+ openssl-dev \
+ pax-utils \
+ readline-dev \
+ sqlite-dev \
+ zlib-dev \
&& cd /usr/src/python \
&& ./configure --enable-shared --enable-unicode=ucs4 \
- && make -j$(nproc) \
+ && make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
- && ldconfig \
&& curl -fSL 'https://bootstrap.pypa.io/get-pip.py' | python2 \
&& pip install --no-cache-dir --upgrade pip==$PYTHON_PIP_VERSION \
&& 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 \
+ && runDeps="$( \
+ scanelf --needed --nobanner --recursive /usr/local \
+ | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
+ | sort -u \
+ | xargs -r apk info --installed \
+ | sort -u \
+ )" \
+ && apk add --virtual .python-rundeps $runDeps \
+ && apk del .fetch-deps \
+ && apk del .build-deps \
&& rm -rf /usr/src/python
# install "virtualenv", since the vast majority of users of this image will want it $ git diff --no-index 2.7/Dockerfile 2.7/slim/Dockerfile
diff --git a/2.7/Dockerfile b/2.7/slim/Dockerfile
index 50bab75..2eede36 100644
--- a/2.7/Dockerfile
+++ b/2.7/slim/Dockerfile
@@ -1,4 +1,4 @@
-FROM buildpack-deps:jessie
+FROM debian:jessie
# remove several traces of debian python
RUN apt-get purge -y python.*
@@ -7,6 +7,12 @@ RUN apt-get purge -y python.*
# > 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 --no-install-recommends \
+ ca-certificates \
+ libsqlite3-0 \
+ libssl1.0.0 \
+ && rm -rf /var/lib/apt/lists/*
+
# gpg: key 18ADD4FF: public key "Benjamin Peterson <benjamin@python.org>" imported
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
@@ -16,6 +22,20 @@ ENV PYTHON_VERSION 2.7.11
ENV PYTHON_PIP_VERSION 7.1.2
RUN set -ex \
+ && buildDeps=' \
+ curl \
+ gcc \
+ libbz2-dev \
+ libc6-dev \
+ libncurses-dev \
+ libreadline-dev \
+ libsqlite3-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/* \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
@@ -36,6 +56,7 @@ RUN set -ex \
\( -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 |
30d1c63
to
326d146
Compare
After building, the line that installs |
Great work @tianon 👍 |
Travis is being too slow, LGTM $ bashbrew build "python"
Cloning python (git://github.com/infosiftr/python) ...
Processing python:2.7.11 ...
Processing python:2.7 ...
Processing python:2 ...
Processing python:2.7.11-onbuild ...
Processing python:2.7-onbuild ...
Processing python:2-onbuild ...
Processing python:2.7.11-slim ...
Processing python:2.7-slim ...
Processing python:2-slim ...
Processing python:2.7.11-alpine ...
Processing python:2.7-alpine ...
Processing python:2-alpine ...
Processing python:2.7.11-wheezy ...
Processing python:2.7-wheezy ...
Processing python:2-wheezy ...
Processing python:3.2.6 ...
Processing python:3.2 ...
Processing python:3.2.6-onbuild ...
Processing python:3.2-onbuild ...
Processing python:3.2.6-slim ...
Processing python:3.2-slim ...
Processing python:3.2.6-wheezy ...
Processing python:3.2-wheezy ...
Processing python:3.3.6 ...
Processing python:3.3 ...
Processing python:3.3.6-onbuild ...
Processing python:3.3-onbuild ...
Processing python:3.3.6-slim ...
Processing python:3.3-slim ...
Processing python:3.3.6-wheezy ...
Processing python:3.3-wheezy ...
Processing python:3.4.4 ...
Processing python:3.4 ...
Processing python:3.4.4-onbuild ...
Processing python:3.4-onbuild ...
Processing python:3.4.4-slim ...
Processing python:3.4-slim ...
Processing python:3.4.4-wheezy ...
Processing python:3.4-wheezy ...
Processing python:3.5.1 ...
Processing python:3.5 ...
Processing python:3 ...
Processing python:latest ...
Processing python:3.5.1-onbuild ...
Processing python:3.5-onbuild ...
Processing python:3-onbuild ...
Processing python:onbuild ...
Processing python:3.5.1-slim ...
Processing python:3.5-slim ...
Processing python:3-slim ...
Processing python:slim ...
Processing python:3.5.1-alpine ...
Processing python:3.5-alpine ...
Processing python:3-alpine ...
Processing python:alpine ...
$ bashbrew list --uniq "$url" | xargs test/run.sh
testing python:2.7.11
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8]...passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:2.7.11-onbuild
'override-cmd' [1/1]...passed
testing python:2.7.11-slim
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8]...passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:2.7.11-alpine
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8]...passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:2.7.11-wheezy
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8]...passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:3.2.6
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8].../usr/local/lib/python3.2/site-packages/pkg_resources/__init__.py:106: UserWarning: Support for Python 3.0-3.2 has been dropped. Future versions will fail here.
warnings.warn(msg)
/usr/local/lib/python3.2/site-packages/pkg_resources/__init__.py:106: UserWarning: Support for Python 3.0-3.2 has been dropped. Future versions will fail here.
warnings.warn(msg)
passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:3.2.6-onbuild
'override-cmd' [1/1]...passed
testing python:3.2.6-slim
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8].../usr/local/lib/python3.2/site-packages/pkg_resources/__init__.py:106: UserWarning: Support for Python 3.0-3.2 has been dropped. Future versions will fail here.
warnings.warn(msg)
/usr/local/lib/python3.2/site-packages/pkg_resources/__init__.py:106: UserWarning: Support for Python 3.0-3.2 has been dropped. Future versions will fail here.
warnings.warn(msg)
passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:3.2.6-wheezy
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8].../usr/local/lib/python3.2/site-packages/pkg_resources/__init__.py:106: UserWarning: Support for Python 3.0-3.2 has been dropped. Future versions will fail here.
warnings.warn(msg)
/usr/local/lib/python3.2/site-packages/pkg_resources/__init__.py:106: UserWarning: Support for Python 3.0-3.2 has been dropped. Future versions will fail here.
warnings.warn(msg)
passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:3.3.6
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8]...passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:3.3.6-onbuild
'override-cmd' [1/1]...passed
testing python:3.3.6-slim
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8]...passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:3.3.6-wheezy
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8]...passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:3.4.4
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8]...passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:3.4.4-onbuild
'override-cmd' [1/1]...passed
testing python:3.4.4-slim
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8]...passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:3.4.4-wheezy
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8]...passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:3.5.1
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8]...passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:3.5.1-onbuild
'override-cmd' [1/1]...passed
testing python:3.5.1-slim
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8]...passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed
testing python:3.5.1-alpine
'utc' [1/8]...passed
'cve-2014--shellshock' [2/8]...passed
'no-hard-coded-passwords' [3/8]...passed
'override-cmd' [4/8]...passed
'python-hy' [5/8]...passed
'python-imports' [6/8]...passed
'python-pip-requests-ssl' [7/8]...passed
'python-sqlite3' [8/8]...passed $ # ./generate-stackbrew.sh; s/docker-library/infosiftr/
$ cat library/python
# maintainer: InfoSiftr <github@infosiftr.com> (@infosiftr)
2.7.11: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 2.7
2.7: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 2.7
2: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 2.7
2.7.11-onbuild: git://github.com/infosiftr/python@7663560df7547e69d13b1b548675502f4e0917d1 2.7/onbuild
2.7-onbuild: git://github.com/infosiftr/python@7663560df7547e69d13b1b548675502f4e0917d1 2.7/onbuild
2-onbuild: git://github.com/infosiftr/python@7663560df7547e69d13b1b548675502f4e0917d1 2.7/onbuild
2.7.11-slim: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 2.7/slim
2.7-slim: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 2.7/slim
2-slim: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 2.7/slim
2.7.11-alpine: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 2.7/alpine
2.7-alpine: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 2.7/alpine
2-alpine: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 2.7/alpine
2.7.11-wheezy: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 2.7/wheezy
2.7-wheezy: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 2.7/wheezy
2-wheezy: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 2.7/wheezy
3.2.6: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.2
3.2: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.2
3.2.6-onbuild: git://github.com/infosiftr/python@7663560df7547e69d13b1b548675502f4e0917d1 3.2/onbuild
3.2-onbuild: git://github.com/infosiftr/python@7663560df7547e69d13b1b548675502f4e0917d1 3.2/onbuild
3.2.6-slim: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.2/slim
3.2-slim: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.2/slim
3.2.6-wheezy: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.2/wheezy
3.2-wheezy: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.2/wheezy
3.3.6: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.3
3.3: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.3
3.3.6-onbuild: git://github.com/infosiftr/python@7663560df7547e69d13b1b548675502f4e0917d1 3.3/onbuild
3.3-onbuild: git://github.com/infosiftr/python@7663560df7547e69d13b1b548675502f4e0917d1 3.3/onbuild
3.3.6-slim: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.3/slim
3.3-slim: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.3/slim
3.3.6-wheezy: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.3/wheezy
3.3-wheezy: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.3/wheezy
3.4.4: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.4
3.4: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.4
3.4.4-onbuild: git://github.com/infosiftr/python@7663560df7547e69d13b1b548675502f4e0917d1 3.4/onbuild
3.4-onbuild: git://github.com/infosiftr/python@7663560df7547e69d13b1b548675502f4e0917d1 3.4/onbuild
3.4.4-slim: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.4/slim
3.4-slim: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.4/slim
3.4.4-wheezy: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.4/wheezy
3.4-wheezy: git://github.com/infosiftr/python@033320b278e78732e5739f19bca5f8f29573b553 3.4/wheezy
3.5.1: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 3.5
3.5: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 3.5
3: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 3.5
latest: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 3.5
3.5.1-onbuild: git://github.com/infosiftr/python@0fa3202789648132971160f686f5a37595108f44 3.5/onbuild
3.5-onbuild: git://github.com/infosiftr/python@0fa3202789648132971160f686f5a37595108f44 3.5/onbuild
3-onbuild: git://github.com/infosiftr/python@0fa3202789648132971160f686f5a37595108f44 3.5/onbuild
onbuild: git://github.com/infosiftr/python@0fa3202789648132971160f686f5a37595108f44 3.5/onbuild
3.5.1-slim: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 3.5/slim
3.5-slim: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 3.5/slim
3-slim: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 3.5/slim
slim: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 3.5/slim
3.5.1-alpine: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 3.5/alpine
3.5-alpine: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 3.5/alpine
3-alpine: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 3.5/alpine
alpine: git://github.com/infosiftr/python@326d146f38fd2bbdaed8c37442a81d6486b5bf2b 3.5/alpine |
Adjust alpine and standard variants to be closer in sync
New relevant diffs: