Skip to content

Commit

Permalink
update docker-compose for hardware integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Yolnan committed Mar 12, 2024
1 parent 2e822b4 commit 49d36fb
Showing 1 changed file with 33 additions and 14 deletions.
47 changes: 33 additions & 14 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ services:
environment:
DISPLAY: $DISPLAY
XAUTHORITY: $XAUTHORITY
NVIDIA_DRIVER_CAPABILITIES: all
ROS_LOG_DIR: /tmp
ROS_LOCALHOST_ONLY: 1
# NVIDIA_DRIVER_CAPABILITIES: all
ROS_LOG_DIR: /tmp/.ros
ROS_LOCALHOST_ONLY: $ROS_LOCALHOST_ONLY
ROS_DOMAIN_ID: $ROS_DOMAIN_ID
container_name: snp_automate_2022
image: ghcr.io/ros-industrial-consortium/snp_automate_2022:foxy-master
stdin_open: true
Expand All @@ -28,20 +29,38 @@ services:
- /etc/group:/etc/group:ro
- /etc/shadow:/etc/shadow:ro
- /dev:/dev
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]

# ROS1 bridge
ros1-bridge:
environment:
ROS_LOG_DIR: /tmp
ROS_LOCALHOST_ONLY: 1
ROS_LOCALHOST_ONLY: $ROS_LOCALHOST_ONLY
ROS_DOMAIN_ID: $ROS_DOMAIN_ID
ROS_LOG_DIR: /tmp/.ros
volumes:
# Mount DDS shared memory location; see https://stackoverflow.com/questions/65900201/troubles-communicating-with-ros2-node-in-docker-container
- /dev/shm:/dev/shm
- /etc/hosts:/etc/hosts
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
- /etc/shadow:/etc/shadow:ro
stdin_open: true
tty: true
container_name: ros1-bridge
image: ghcr.io/ros-industrial/ros1_bridge:noetic-foxy
tty: true
privileged: true
network_mode: host

# Run as the same user as the other system
# CURRENT_UID=$(id -u):$(id -g)
user: ${CURRENT_UID}

# Share the network with the host PC
network_mode: host
ipc: host
pid: host

0 comments on commit 49d36fb

Please sign in to comment.