-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_docker.sh
executable file
·32 lines (27 loc) · 989 Bytes
/
run_docker.sh
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
#!/bin/bash
################################################################################
# This is supposedly insecure... use Google to find a safer solution if you like
#xhost +local:root
################################################################################
#IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
IP=$(hostname -I|cut -f1 -d ' ')
xhost + $IP
git_name=$(git config --global user.name)
git_email=$(git config --global user.email)
nvidia-docker run \
-it \
-e DISPLAY=$DISPLAY \
-e QT_X11_NO_MITSHM=1 \
-e LUID=$(id -u) \
-e LGID=$(id -g) \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /home/$USER:/home/$USER \
-v /home/$USER/.Xauthority:/home/dluser/.Xauthority:rw \
-v /media:/media \
-v /data/$USER:/data/$USER \
--net=host \
--shm-size=16G \
--name ${USER}_$(date +%d_%m_%Y_%H_%M_%S) \
--privileged \
--rm \
"$@" bash -c "git config --global user.name '$git_name' && git config --global user.email '$git_email' && bash"