forked from ampervue/docker-python34
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
144 lines (127 loc) · 3.79 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
FROM ubuntu:trusty
# https://github.com/ampervue/docker-python34
# https://hub.docker.com/r/ampervue/python34
MAINTAINER David Karchmer <[email protected]>
#####################################################################
#
# A base building block with Python 3.4 used by:
#
# - https://hub.docker.com/r/dkarchmervue/python34-ffmpeg
# - https://hub.docker.com/r/dkarchmervue/python34-opencv
#
# Image based on Ubuntu:14.04
#
# with
# - Latest Python 3.4
# - Latest FFMPEG (built)
# - ImageMagick
#
# plus a bunch of build/web essentials
#
#####################################################################
ENV PYTHON_VERSION 3.4.4
ENV PYTHON_PIP_VERSION 8.0.2
ENV YASM_VERSION 1.3.0
ENV NUM_CORES 4
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN apt-get -qq remove ffmpeg
# remove several traces of python
RUN apt-get purge -y python.*
# Add the following two dependencies if you want to use --enable-gnutls in FFPMEG: gnutls-bin
RUN echo deb http://archive.ubuntu.com/ubuntu trusty universe multiverse >> /etc/apt/sources.list; \
apt-get update -qq && apt-get install -y --force-yes \
ant \
autoconf \
automake \
build-essential \
curl \
checkinstall \
cmake \
default-jdk \
f2c \
gfortran \
git \
g++ \
imagemagick \
libass-dev \
libatlas-base-dev \
libavcodec-dev \
libavformat-dev \
libcnf-dev \
libfaac-dev \
libfreeimage-dev \
libjpeg-dev \
libjasper-dev \
libgnutls-dev \
liblapack3 \
libmp3lame-dev \
libpq-dev \
libpng-dev \
libssl-dev \
libtheora-dev \
libtiff4-dev \
libtool \
libxine-dev \
libxvidcore-dev \
libv4l-dev \
libvorbis-dev \
mercurial \
openssl \
pkg-config \
postgresql-client \
supervisor \
wget \
unzip; \
apt-get clean
# gpg: key F73C700D: public key "Larry Hastings <[email protected]>" imported
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
RUN set -x \
&& mkdir -p /usr/src/python \
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
&& curl -SL "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 \
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
&& rm python.tar.xz* \
&& 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 '{}' + \
&& 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
RUN pip3 install --no-cache-dir --upgrade --ignore-installed pip==$PYTHON_PIP_VERSION
WORKDIR /usr/local/src
RUN curl -Os http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz \
&& tar xzvf yasm-${YASM_VERSION}.tar.gz
# Build YASM
# =================================
WORKDIR /usr/local/src/yasm-${YASM_VERSION}
RUN ./configure \
&& make -j ${NUM_CORES} \
&& make install
# =================================
# Remove all tmpfile and cleanup
# =================================
WORKDIR /usr/local/
RUN rm -rf /usr/local/src
RUN apt-get autoremove -y; apt-get clean -y
# =================================
# Setup a working directory to allow for
# docker run --rm -ti -v ${PWD}:/work ...
# =======================================
RUN mkdir /work
WORKDIR /work