-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-tox
41 lines (37 loc) · 1.41 KB
/
Dockerfile-tox
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
# Inspired by https://github.com/kiwicom/dockerfiles/tree/master/tox. It's non-extendible
# unfortunately. Also we don't use Alpine Linux as parent because it's MUSL system,
# but we required for manylinux1-compatible environment to install protobuf package etc.
FROM python:3.8-slim-buster
LABEL maintainer="[email protected]"
ENV PATH="$PATH:/root/.pyenv/bin:/root/.pyenv/shims"
RUN set -ex; \
apt-get -qy update; \
# A partial list from https://github.com/pyenv/pyenv/wiki/Common-build-problems#prerequisites
apt-get -qy install \
build-essential \
curl \
git \
libbz2-dev \
libffi-dev \
liblzma-dev \
libncurses5-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
python-openssl \
xz-utils \
zlib1g-dev \
; \
curl --location https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash; \
pyenv update; \
pyenv install 3.7.6; \
pyenv install 3.8.1; \
pyenv global 3.8.1 3.7.6; \
pyenv rehash; \
pip install tox==3.14.2; \
rm -rf /var/lib/apt/lists/*; \
rm -rf /tmp/*; \
find /root/.pyenv/versions -type d '(' -name '__pycache__' -o -name 'test' -o -name 'tests' ')' -exec rm -rfv '{}' +; \
find /root/.pyenv/versions -type f '(' -name '*.py[co]' -o -name '*.exe' ')' -exec rm -fv '{}' +
CMD ["tox"]