-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
78 lines (77 loc) · 3.28 KB
/
docker-compose.yml
File metadata and controls
78 lines (77 loc) · 3.28 KB
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
services:
dev:
env_file: .env
build:
context: .
dockerfile: Dockerfile
target: er4-dev
tags:
- er4-dev:${ROS2_DISTRO:-jazzy}
args:
- USERNAME=er4-user # Changing username requires updating workspace mounts below
- USER_UID=${USER_UID:-1000}
- USER_GID=${USER_GID:-1000}
- ROS_DISTRO=${ROS2_DISTRO:-jazzy}
# Ensures signals are actually passed and reaped in the container for shutdowns
# https://docs.docker.com/compose/compose-file/compose-file-v3/#init
init: true
stdin_open: true
tty: true
privileged: true
network_mode: host
# Ensures the UR drivers have access to RT priority
ulimits:
rtprio: 99
environment:
# Pass the ROS_DOMAIN_ID from the host, if available, otherwise we default to 1 to avoid spamming networks
- ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-1}
# Enable running graphical applications from inside the container
- DISPLAY
- QT_X11_NO_MITSHM=1
# This service will attempt to mount and use the DDS configuration from the host, if it is defined.
# Otherwise, it will fall back to localhost only configuration using cyclonedds.
- RMW_IMPLEMENTATION=${RMW_IMPLEMENTATION:-rmw_cyclonedds_cpp}
- CYCLONEDDS_URI=/cyclonedds.xml
- FASTRTPS_DEFAULT_PROFILES_FILE=/fastdds.xml
# make the bash history folder link to our local .bash so that we can rtain info between container starts
- HISTFILE=/home/er4-user/.bash/.bash_history
# default to colorized output of ros logs
- RCUTILS_COLORIZED_OUTPUT=1
- NVIDIA_DRIVER_CAPABILITIES=all
# If using an nvidia driver uncomment these lines
# runtime: nvidia
# deploy:
# resources:
# reservations:
# devices:
# - capabilities: [gpu]
# count: all
volumes:
# If they are present, mount DDS configurations from the host machine into the container.
# If not, fallback to the default localhost configurations for both fastrtps and cyclonedds.
- ${CYCLONEDDS_URI:-./config/cyclonedds.xml}:/cyclonedds.xml:ro
- ${FASTRTPS_DEFAULT_PROFILES_FILE:-./config/fastdds.xml}:/fastdds.xml:ro
# If you build this locally with the correct user information then this shouldn't be an issue
# mounting without bindfs
- ./src:/home/er4-user/ws/src/:rw
# Bind mount folders into the container for preserving build artifacts
- ./build:/home/er4-user/ws/build/:rw
- ./install:/home/er4-user/ws/install/:rw
- ./log:/home/er4-user/ws/log/:rw
- ./.ccache:/home/er4-user/.ccache
- ./.bash:/home/er4-user/.bash
# For rendering graphical commands inside the container
- x11_sock:/tmp/.X11-unix
- /tmp/.X11-unix:/tmp/.X11-unix:ro
- $HOME/.Xauthority:/home/${HOST_USERNAME:-er4-user}/.Xauthority:rw
command: sleep infinity
# The hardware service includes any additional specifications for running on CLR hardware.
hw:
extends: dev
volumes:
# The controller machine requires access to some devices for hardware comms.
# Including, but not necessarily limited to the Hand-E gripper and Lift.
# TODO: Mount specific devices by name conventions, rather than all of /dev
- /dev:/dev
command: sleep infinity
profiles: [ hw ]