-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathDockerfile
50 lines (42 loc) · 1.45 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
# base container
FROM nvidia/cuda::10.0-devel-ubuntu18.04
# update
ENV DEBIAN_FRONTEND "noninteractive"
RUN apt-get update -y
RUN apt-get -y \
-o Dpkg::Options::="--force-confdef" \
-o Dpkg::Options::="--force-confold" dist-upgrade
# install basic
RUN apt-get install -y --no-install-recommends \
less sudo ssh \
build-essential \
unzip git curl wget vim tree htop \
python3-dev python3-tk \
ninja-build
# python libs
RUN curl https://bootstrap.pypa.io/get-pip.py | python3
RUN pip3 install \
future six cffi numpy pillow tqdm Cython awscli ninja
# install pytorch
RUN pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.0-cp36-cp36m-linux_x86_64.whl
RUN pip3 install torchvision
# clean up
RUN apt-get update -y && apt-get upgrade -y && apt-get autoremove -y
RUN apt-get clean -y && apt-get autoclean -y
RUN rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
# create mountpoint from host
RUN mkdir -p /workspace
# create non-root user
ARG user_name=ubuntu
ARG user_id=1000
ARG group_name=ubuntu
ARG group_id=1000
RUN groupadd -g ${group_id} ${group_name}
RUN useradd -u ${user_id} -g ${group_id} -d /home/${user_name} --create-home --shell /bin/bash ${user_name}
RUN echo "${user_name} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
RUN chown -R ${user_name}:${group_name} /home/${user_name}
RUN chown -R ${user_name}:${group_name} /workspace
RUN chsh -s /bin/bash ${user_name}
USER ubuntu
WORKDIR /home/ubuntu
ENV HOME /home/ubuntu