-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile
50 lines (39 loc) · 1.31 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
FROM debian:buster
ENV PYTHONUNBUFFERED=1 \
DEBIAN_FRONTEND=noninteractive
RUN \
echo "Install base packages" \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
gcc \
git \
gnupg \
curl \
ca-certificates \
# pyenv dependencies (https://github.com/pyenv/pyenv/wiki#suggested-build-environment)
make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev \
libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev \
libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \
&& echo "Clean up" \
&& rm -rf /tmp/*
RUN \
echo "install pyenv" \
&& curl https://pyenv.run | bash
ENV PYENV_ROOT /root/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
RUN ls /root/.pyenv/bin
RUN eval "$(/root/.pyenv/bin/pyenv init - )"
WORKDIR /var/project
COPY tox-python-versions .
RUN \
echo "Install python based on .python-version file" \
&& while read line; do pyenv install "$line" < /dev/null; done < tox-python-versions
# Make all files available so we can run "make bootstrap" and install dependencies.
COPY . .
# Make pyenv activate all installed Python versions for tox (available as pythonX.Y)
# The first version will be the one used when running "python"
RUN pyenv global $(tr '\n' ' ' < tox-python-versions)
RUN make bootstrap
RUN \
echo "installing tox" \
&& pip install tox