-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
55 lines (41 loc) · 1.34 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
FROM pytorch/pytorch:1.10.0-cuda11.3-cudnn8-devel
# Package version control
ARG PYTHON_VERSION=3.8
ARG CUDA_VERSION=11.3
ARG PYTORCH_VERSION=1.10
ARG CUDA_CHANNEL=nvidia
ARG INSTALL_CHANNEL=pytorch
# Setup workdir and non-root user
ARG USERNAME=dreamer
WORKDIR /home/$USERNAME/workspace/
# https://github.com/NVIDIA/nvidia-docker/issues/1632
RUN rm /etc/apt/sources.list.d/cuda.list
RUN rm /etc/apt/sources.list.d/nvidia-ml.list
RUN apt-get update &&\
apt-get install -y --no-install-recommends curl git sudo &&\
useradd --create-home --shell /bin/bash $USERNAME &&\
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME &&\
chmod 0440 /etc/sudoers.d/$USERNAME &&\
rm -rf /var/lib/apt/lists/*
RUN chown -R $USERNAME:$USERNAME /home/$USERNAME/
RUN --mount=type=cache,id=apt-dev,target=/var/cache/apt \
apt-get -qq update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
ccache \
cmake \
gcc \
tmux \
libjpeg-dev \
unzip bzip2 ffmpeg libsm6 libxext6 \
libpng-dev && \
rm -rf /var/lib/apt/lists/*
# Install repo dependencies
COPY ./ .
RUN chown -R $USERNAME:$USERNAME /home/$USERNAME/
SHELL ["/bin/bash","-c"]
RUN python -m pip install -r requirements.txt
WORKDIR ESRGAN
RUN python setup.py install
USER $USERNAME
WORKDIR /home/$USERNAME/workspace/