-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
36 lines (34 loc) · 1.22 KB
/
Dockerfile.template
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
FROM amazonlinux:%%PLACEHOLDER%%
ARG PYTHON_VERSION=%%PLACEHOLDER%%
ARG PYTHON_VERSION_ONLYMAJOR=%%PLACEHOLDER%%
RUN yum -y update &&\
yum install -y shadow-utils findutils gcc sqlite-devel zlib-devel \
bzip2-devel openssl-devel readline-devel libffi-devel tar gzip make && \
cd /usr/local/src && \
curl -O https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz && \
tar -xvzf Python-${PYTHON_VERSION}.tgz && \
cd Python-${PYTHON_VERSION} && \
./configure --enable-optimizations && make && make altinstall && \
rm -rf /usr/local/src/Python-${PYTHON_VERSION}* && \
yum remove -y shadow-utils audit-libs libcap-ng && yum -y autoremove && \
yum clean all
ENV PYTHONUNBUFFERED 1
RUN yum install -y \
python3-devel \
openldap-devel \
libxml2-devel \
xmlsec1-devel \
xmlsec1-openssl-devel \
libtool-ltdl-devel \
epel-release \
python3-pip \
cairo-devel \
pango \
gcc-c++ \
zlib-devel \
libjpeg-devel \
openjpeg2-devel \
libffi-devel \
mysql-devel
RUN ln -fs /usr/local/bin/python${PYTHON_VERSION_ONLYMAJOR} /usr/local/bin/python \
&& ln -fs /usr/local/bin/pip${PYTHON_VERSION_ONLYMAJOR} /usr/local/bin/pip