-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-dev
56 lines (56 loc) · 2.1 KB
/
Dockerfile-dev
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
FROM nvidia/cuda:10.2-cudnn8-devel-ubuntu18.04
# UTF-8 encoding is necessary for printing non-ASCII characters to the
# terminal.
ENV LC_ALL C.UTF-8
# Install Python.
# Note that PyTorch does not yet support Python later than 3.9.
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
# Installs add-apt-repository.
software-properties-common \
&& \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python3.9 \
python3.9-dev \
# Required by Poetry
python3.9-venv \
# Required by numpy
python3.9-distutils \
# Required by matplotlib
python3.9-tk \
&& \
rm -rf /var/lib/apt/lists/*
# Poetry won't get installed correctly unless a `python` binary is present.
# The specific Python installation it points to also needs to have the venv
# module installed. The version of Python used to run the installation script
# should also match.
RUN ln -s "`which python3.9`" /usr/local/bin/python && \
ln -sf "`which python3.9`" /usr/local/bin/python3
# Install some other packages.
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
curl \
unzip \
texlive-xetex \
&& \
rm -rf /var/lib/apt/lists/*
# Install Poetry.
# See https://python-poetry.org/docs/#installing-with-the-official-installer
RUN cd /tmp && \
curl -sSL https://install.python-poetry.org > install-poetry.py && \
POETRY_HOME=/usr/local/poetry python3 install-poetry.py && \
rm install-poetry.py
ENV PATH /usr/local/poetry/bin:${PATH}
# Stores Python packages in the local directory.
# See https://python-poetry.org/docs/configuration/#virtualenvsin-project
ENV POETRY_VIRTUALENVS_IN_PROJECT true
# Install git.
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git \
&& \
rm -rf /var/lib/apt/lists/*
ENV PYTHONPATH /app/src:${PYTHONPATH}
WORKDIR /app/