forked from RobotLocomotion/pytorch-dense-correspondence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpytorch-dense-correspondence.dockerfile
96 lines (71 loc) · 2.9 KB
/
pytorch-dense-correspondence.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04
ARG USER_NAME
ARG USER_PASSWORD
ARG USER_ID
ARG USER_GID
RUN apt-get update
RUN apt install sudo
RUN useradd -ms /bin/bash $USER_NAME
RUN usermod -aG sudo $USER_NAME
RUN yes $USER_PASSWORD | passwd $USER_NAME
# set uid and gid to match those outside the container
RUN usermod -u $USER_ID $USER_NAME
RUN groupmod -g $USER_GID $USER_NAME
WORKDIR /home/$USER_NAME
ENV USER_HOME_DIR=/home/$USER_NAME
COPY ./install_dependencies.sh /tmp/install_dependencies.sh
RUN yes "Y" | /tmp/install_dependencies.sh
COPY ./install_pytorch.sh /tmp/install_pytorch.sh
RUN yes "Y" | /tmp/install_pytorch.sh
COPY ./install_more.sh /tmp/install_more.sh
RUN yes "Y" | /tmp/install_more.sh
# install director
COPY ./install_director.sh /tmp/install_director.sh
RUN cd $WORKDIR && yes "Y" | /tmp/install_director.sh
# set the terminator inside the docker container to be a different color
RUN mkdir -p .config/terminator
COPY ./terminator_config .config/terminator/config
# install GLX-Gears
RUN apt-get update && apt-get install -y \
mesa-utils && \
rm -rf /var/lib/apt/lists/*
###### COMMENT OUT THIS BLOCK IF USING NVIDIA-DOCKER1 ###########
# needed to get OpenGL running inside the docker
# https://github.com/machinekoder/nvidia-opengl-docker
# optional, if the default user is not "root", you might need to switch to root here and at the end of the script to the original user again.
# e.g.
# USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config \
libxau-dev \
libxdmcp-dev \
libxcb1-dev \
libxext-dev \
libx11-dev && \
rm -rf /var/lib/apt/lists/*
# replace with other Ubuntu version if desired
# see: https://hub.docker.com/r/nvidia/opengl/
# e.g. nvidia/opengl:1.1-glvnd-runtime-ubuntu16.04)
COPY --from=machinekoder/nvidia-opengl-docker:1.1-glvnd-runtime-stretch \
/usr/local/lib/x86_64-linux-gnu \
/usr/local/lib/x86_64-linux-gnu
# replace with other Ubuntu version if desired
# see: https://hub.docker.com/r/nvidia/opengl/
# e.g. nvidia/opengl:1.1-glvnd-runtime-ubuntu16.04
COPY --from=machinekoder/nvidia-opengl-docker:1.1-glvnd-runtime-stretch \
/usr/local/share/glvnd/egl_vendor.d/10_nvidia.json \
/usr/local/share/glvnd/egl_vendor.d/10_nvidia.json
RUN echo '/usr/local/lib/x86_64-linux-gnu' >> /etc/ld.so.conf.d/glvnd.conf && \
ldconfig && \
echo '/usr/local/$LIB/libGL.so.1' >> /etc/ld.so.preload && \
echo '/usr/local/$LIB/libEGL.so.1' >> /etc/ld.so.preload
# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES \
${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES \
${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
# USER original_user
###### END BLOCK ###########
# change ownership of everything to our user
RUN cd ${USER_HOME_DIR} && echo $(pwd) && chown $USER_NAME:$USER_NAME -R .
ENTRYPOINT bash -c "source ~/code/docker/entrypoint.sh && /bin/bash"