-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathDockerfile
43 lines (32 loc) · 1.02 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
FROM nvidia/cuda:11.4.1-cudnn8-devel-ubuntu20.04
#########
# Credit: https://github.com/askforalfred/alfred/blob/master/Dockerfile
#########
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
# work directory
WORKDIR /home/$USER_NAME
# install system dependencies
COPY ./docker/install_deps.sh /tmp/install_deps.sh
RUN chmod +x /tmp/install_deps.sh
RUN yes "Y" | /tmp/install_deps.sh
# setup python environment
RUN cd $WORKDIR
# install GLX-Gears (for debugging)
RUN apt-get update && apt-get install -y \
mesa-utils && \
rm -rf /var/lib/apt/lists/*
# change ownership of everything to our user
RUN cd ${USER_HOME_DIR} && echo $(pwd) && chown $USER_NAME:$USER_NAME -R .
# entry point
ENTRYPOINT bash -c "export OMG_ROOT=~/OMG && /bin/bash"