diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index c240130..72a6844 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -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 @@ -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 \ No newline at end of file + + # 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 \ No newline at end of file