-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
55 lines (52 loc) · 2.11 KB
/
docker-compose.yml
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
version: "3.4"
services:
dev:
build:
context: ./
dockerfile: ./Dockerfile
args:
ROS_DISTRO: ${ROS_DISTRO}
image: rif/ros:${ROS_DISTRO}
container_name: ros_${ROS_DISTRO}
network_mode: "host" # access to host's network
stdin_open: true # docker run -i
tty: true # docker run -t
privileged: true # Needed for /dev volume
environment:
- DISPLAY=${DISPLAY} # Pass the display for GUI
- QT_X11_NO_MITSHM=1 # Needed by QT programs
- XAUTHORITY=/tmp/.docker.xauth
- USER_ID=${USER_ID}
- GROUP_ID=${GROUP_ID}
- TERM=xterm-256color # Enable terminal colors
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw # Connect X11
- .docker.xauth:/tmp/.docker.xauth # Provide the generated xauth file
- /dev:/dev # Needed for sensors
# Source code volume mounts
# /home/<host-user>/ros1/workspace/src:/home/ros/workspace/src
# - ${HOME}/ros1/workspace_2/src:/home/ros/workspace/src
dev-nvidia:
image: rif/ros:${ROS_DISTRO}
container_name: ros_${ROS_DISTRO}_nvidia
network_mode: "host" # access to host's network
stdin_open: true # docker run -i
tty: true # docker run -t
privileged: true # Needed for /dev volume
runtime: nvidia
environment:
- DISPLAY=${DISPLAY} # Pass the display for GUI
- QT_X11_NO_MITSHM=1 # Needed by QT programs
- XAUTHORITY=/tmp/.docker.xauth
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- USER_ID=${USER_ID}
- GROUP_ID=${GROUP_ID}
- TERM=xterm-256color # Enable terminal colors
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw # Connect X11
- .docker.xauth:/tmp/.docker.xauth # Provide the generated xauth file
- /dev:/dev # Needed for sensors
# Source code volume mounts
# /home/<host-user>/ros1/workspace/src:/home/ros/workspace/src
# - ${HOME}/ros1/workspace_2/src:/home/ros/workspace/src