-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (24 loc) · 1.04 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
FROM amazonlinux:2017.03
# Make sure we're up-to-date
RUN yum update -y
# Install runtime requirements
RUN yum install -y binutils bzip2 gcc gcc-c++ gdbm libffi ncurses openssl \
openssl readline sqlite xmlsec1 xmlsec1-openssl xz zlib zip
# Install build requirements
RUN yum install -y bzip2-devel gdbm-devel libffi-devel ncurses-devel \
openssl-devel readline-devel sqlite-devel xz-devel zlib-devel
RUN mkdir /tmp/python-3.6-build
WORKDIR /tmp/python-3.6-build
RUN curl -o Python-3.6.2.tgz \
https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz
RUN tar xfz Python-3.6.2.tgz
WORKDIR /tmp/python-3.6-build/Python-3.6.2
RUN ./configure --prefix=/usr --with-system-ffi --with-cxx-main=g++
# Make in parallel with 2x the number of processors.
RUN make -j $(( 2 * $(cat /proc/cpuinfo | egrep ^processor | wc -l) ))
RUN make install
WORKDIR /
RUN rm -rf /tmp/python-3.6-build
# Remove build-only requirements
RUN yum remove -y bzip2-devel gdbm-devel libffi-devel ncurses-devel \
openssl-devel readline-devel sqlite-devel xz-devel zlib-devel zip-devel