-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (53 loc) · 1.93 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
51
52
53
54
55
56
57
58
59
60
61
ARG UBUNTU_VERSION=18.04
ARG CUDA_VERSION=11.7.0
ARG PYTORCH_CUDA=11.7
FROM nvidia/cuda:${CUDA_VERSION}-base-ubuntu${UBUNTU_VERSION}
ARG DEBIAN_FRONTEND=noninteractive
ENV PIP_ROOT_USER_ACTION=ignore
ARG PYTHON_VERSION=3.8
# To use the default value of an ARG declared before the first FROM,
# use an ARG instruction without a value inside of a build stage:
ARG CUDA_VERSION
# Install ubuntu packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
git \
curl \
ca-certificates \
locales \
python3-opencv \
libgtk2.0-dev \
libjpeg-dev \
libpng-dev \
byobu \
htop \
vim && \
# Remove the effect of `apt-get update`
rm -rf /var/lib/apt/lists/* && \
# Make the "en_US.UTF-8" locale
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8
# Setup timezone
ENV TZ=Asia/Seoul
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install miniconda (python)
# Referenced PyTorch's Dockerfile:
# https://github.com/pytorch/pytorch/blob/master/docker/pytorch/Dockerfile
RUN curl -o miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
chmod +x miniconda.sh && \
./miniconda.sh -b -p conda && \
rm miniconda.sh && \
conda/bin/conda install -y python=$PYTHON_VERSION jupyter jupyterlab && \
conda/bin/conda install -y pytorch torchvision torchaudio pytorch-cuda=$PYTORCH_CUDA -c pytorch -c nvidia && \
conda/bin/conda clean -ya
ENV PATH $HOME/conda/bin:$PATH
RUN pip install --upgrade pip
RUN pip install flake8 typing mypy pytest pytest-mock
RUN pip install ufmt==1.3.2 black==22.3.0 usort==1.0.2
RUN pip install pre-commit
ADD requirements.txt .
RUN pip install git+https://github.com/pedrodiamel/pytorchvision
RUN pip install -r requirements.txt
WORKDIR /workspaces/torchcls
RUN /bin/bash -c python setup.py develop