-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile-gpu
47 lines (34 loc) · 1.36 KB
/
Dockerfile-gpu
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
FROM noelmni/cuda:10.0-cudnn7-devel-ubuntu18.04
LABEL maintainer="Ravnoor Singh Gill <[email protected]>"
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y git \
bash \
wget \
bzip2 \
sudo \
&& sudo apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV PATH=/home/user/conda/bin:${PATH}
# 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
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py37_23.1.0-1-Linux-x86_64.sh \
&& /bin/bash Miniconda3-py37_23.1.0-1-Linux-x86_64.sh -b -p /home/user/conda \
&& rm Miniconda3-py37_23.1.0-1-Linux-x86_64.sh
RUN conda update -n base -c defaults conda
RUN conda install --yes pytorch cudatoolkit=10.0 -c pytorch \
&& conda clean -ya
COPY app/requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt \
&& rm -rf /home/user/.cache
COPY app/ /app/
RUN sudo chmod -R 777 /app && sudo chmod +x /app/inference.py
CMD ["python3", "inference.py"]