-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile
48 lines (42 loc) · 1.5 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
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
# https://github.com/pytorch/pytorch/blob/master/docker/pytorch/Dockerfile
ARG PYTHON_VERSION=3.6.10
ARG CUDA_TOOLKIT_VERSION=10.1
ARG PYTORCH_VERSION=1.6.0
# Install some basic utilities
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
sudo \
git \
vim \
bzip2 \
libx11-6 \
&& rm -rf /var/lib/apt/lists/*
# Create a working directory
RUN mkdir /app
WORKDIR /app
# Create a non-root user and switch to it
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
&& chown -R user:user /app
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
USER user
# All users can use /home/user as their home directory
ENV HOME=/home/user
RUN chmod 777 /home/user
# Install Miniconda and Python 3.x
ENV CONDA_AUTO_UPDATE_CONDA=false
ENV PATH=/home/user/miniconda/bin:$PATH
RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& chmod +x ~/miniconda.sh \
&& ~/miniconda.sh -b -p ~/miniconda \
&& rm ~/miniconda.sh \
&& conda install -y python==$PYTHON_VERSION numpy scipy pandas plotly matplotlib \
&& conda clean -ya
# Install PyTorch1.x
# https://pytorch.org/get-started/previous-versions/
# https://github.com/anibali/docker-pytorch/blob/master/dockerfiles/1.7.0-cuda11.0-ubuntu20.04/Dockerfile
RUN conda install -y -c pytorch \
cudatoolkit=$CUDA_TOOLKIT_VERSION \
"pytorch=1.6.0=py3.6_cuda10.1.243_cudnn7.6.3_0" \
&& conda clean -ya