-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoshrc
More file actions
37 lines (35 loc) · 894 Bytes
/
Copy pathdoshrc
File metadata and controls
37 lines (35 loc) · 894 Bytes
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
# Use /bin/bash
DOSHELL="/bin/bash"
for file in .bashrc .bash_history
do
[ -e "$PWD/$file" ] || continue
DOSH_DOCKER_RUN_EXTRA_OPTS+=(--volume "$PWD/$file:$HOME/$file")
done
# Map gazebo things?
for dir in .gazebo .ros .sdformat
do
[ -e "$PWD/$dir" ] || continue
DOSH_DOCKER_RUN_EXTRA_OPTS+=(--volume "$PWD/$dir:$HOME/$dir")
done
# Map and export X things?
if [ -n "$DISPLAY" ]
then
for env in DISPLAY XAUTHORITY XSOCK
do
[ -n "$env" ] || continue
DOSH_DOCKER_RUN_EXTRA_OPTS+=(--env "$env")
done
dotxauthority="${XAUTHORITY:-$HOME/.Xauthority}"
if [ -e "$dotxauthority" ]
then
DOSH_DOCKER_RUN_EXTRA_OPTS+=(--volume "$dotxauthority:$HOME/.Xauthority")
fi
unset dotxauthority
xsock="${XSOCK:-/tmp/.X11-unix}"
if [ -e "$xsock" ]
then
DOSH_DOCKER_RUN_EXTRA_OPTS+=(--volume "$xsock:/tmp/.X11-unix:ro")
fi
unset xsock
DOSH_DOCKER_RUN_EXTRA_OPTS+=(--volume "/dev:/dev")
fi