Skip to content

Commit 6ebb4af

Browse files
committed
Merge pull request docker-library#80 from Soullivaneuh/2.7-alpine
Python 2.7 Alpine variant
2 parents 4cce2f7 + 895e408 commit 6ebb4af

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ env:
1616
- VERSION=3.2 VARIANT=wheezy
1717
- VERSION=2.7 VARIANT=
1818
- VERSION=2.7 VARIANT=slim
19+
- VERSION=2.7 VARIANT=alpine
1920
- VERSION=2.7 VARIANT=wheezy
2021

2122
install:

2.7/alpine/Dockerfile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
FROM alpine:3.3
2+
3+
# gpg: key 18ADD4FF: public key "Benjamin Peterson <benjamin@python.org>" imported
4+
ENV GPG_KEY C01E1CAD5EA2C4F0B8E3571504C367C218ADD4FF
5+
6+
ENV PYTHON_VERSION 2.7.11
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/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
15+
&& curl -fSL "https://www.python.org/ftp/python/$PYTHON_VERSION/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+
&& rm -r ~/.gnupg \
22+
\
23+
&& apk add --no-cache --virtual .build-deps \
24+
bzip2-dev \
25+
gcc \
26+
libc-dev \
27+
linux-headers \
28+
make \
29+
ncurses-dev \
30+
openssl-dev \
31+
pax-utils \
32+
readline-dev \
33+
sqlite-dev \
34+
zlib-dev \
35+
&& cd /usr/src/python \
36+
&& ./configure --enable-shared --enable-unicode=ucs4 \
37+
&& make -j$(nproc) \
38+
&& make install \
39+
&& curl -fSL 'https://bootstrap.pypa.io/get-pip.py' | python2 \
40+
&& pip install --no-cache-dir --upgrade 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 .fetch-deps \
54+
&& apk del .build-deps \
55+
&& rm -rf /usr/src/python
56+
57+
CMD ["python2"]

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