Skip to content

Commit f20e921

Browse files
committed
Merge pull request docker-library#74 from ncopa/alpine
[RFC] Add 3.5/alpine variant
2 parents 750546c + a418b4e commit f20e921

File tree

4 files changed

+69
-2
lines changed

4 files changed

+69
-2
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ services: docker
44
env:
55
- VERSION=3.5 VARIANT=
66
- VERSION=3.5 VARIANT=slim
7+
- VERSION=3.5 VARIANT=alpine
78
- VERSION=3.4 VARIANT=
89
- VERSION=3.4 VARIANT=slim
910
- VERSION=3.4 VARIANT=wheezy

3.5/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ ENV PYTHON_VERSION 3.5.1
1616
ENV PYTHON_PIP_VERSION 7.1.2
1717

1818
RUN set -x \
19-
&& mkdir -p /usr/src/python \
2019
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
2120
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
2221
&& gpg --verify python.tar.xz.asc \
22+
&& mkdir -p /usr/src/python \
2323
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
2424
&& rm python.tar.xz* \
25+
\
2526
&& cd /usr/src/python \
2627
&& ./configure --enable-shared --enable-unicode=ucs4 \
2728
&& make -j$(nproc) \

3.5/alpine/Dockerfile

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
FROM alpine:3.3
2+
3+
# gpg: key F73C700D: public key "Larry Hastings <larry@hastings.org>" imported
4+
ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
5+
6+
ENV PYTHON_VERSION 3.5.1
7+
8+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
9+
ENV PYTHON_PIP_VERSION 7.1.2
10+
11+
RUN set -ex \
12+
&& apk add --no-cache --virtual .fetch-deps curl gnupg \
13+
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
14+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
15+
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
16+
&& gpg --verify python.tar.xz.asc \
17+
&& mkdir -p /usr/src \
18+
&& tar -xJC /usr/src -f python.tar.xz \
19+
&& mv "/usr/src/Python-$PYTHON_VERSION" /usr/src/python \
20+
&& rm python.tar.xz* \
21+
&& apk del .fetch-deps \
22+
&& rm -r ~/.gnupg \
23+
\
24+
&& apk add --no-cache --virtual .build-deps \
25+
bzip2-dev \
26+
gcc \
27+
libc-dev \
28+
libedit-dev \
29+
linux-headers \
30+
make \
31+
ncurses-dev \
32+
openssl-dev \
33+
pax-utils \
34+
sqlite-dev \
35+
zlib-dev \
36+
&& cd /usr/src/python \
37+
&& ./configure --enable-shared --enable-unicode=ucs4 \
38+
&& make -j$(getconf _NPROCESSORS_ONLN) \
39+
&& make install \
40+
&& pip3 install --no-cache-dir --upgrade --ignore-installed pip==$PYTHON_PIP_VERSION \
41+
&& find /usr/local \
42+
\( -type d -a -name test -o -name tests \) \
43+
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
44+
-exec rm -rf '{}' + \
45+
&& runDeps="$( \
46+
scanelf --needed --nobanner --recursive /usr/local \
47+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
48+
| sort -u \
49+
| xargs -r apk info --installed \
50+
| sort -u \
51+
)" \
52+
&& apk add --virtual .python-rundeps $runDeps \
53+
&& apk del .build-deps \
54+
&& rm -rf /usr/src/python
55+
56+
# make some useful symlinks that are expected to exist
57+
RUN cd /usr/local/bin \
58+
&& ln -s easy_install-3.5 easy_install \
59+
&& ln -s idle3 idle \
60+
&& ln -s pydoc3 pydoc \
61+
&& ln -s python3 python \
62+
&& ln -s python-config3 python-config
63+
64+
CMD ["python3"]

3.5/slim/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,13 @@ RUN set -x \
3636
zlib1g-dev \
3737
' \
3838
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
39-
&& mkdir -p /usr/src/python \
4039
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
4140
&& curl -fSL "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
4241
&& gpg --verify python.tar.xz.asc \
42+
&& mkdir -p /usr/src/python \
4343
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
4444
&& rm python.tar.xz* \
45+
\
4546
&& cd /usr/src/python \
4647
&& ./configure --enable-shared --enable-unicode=ucs4 \
4748
&& make -j$(nproc) \

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy