Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Latest commit

 

History

History
49 lines (38 loc) · 1.64 KB

File metadata and controls

49 lines (38 loc) · 1.64 KB

<-- Back

Config Explanations

GUI in Docker Containers

Based on this post, use the following configuration to pass the WSL display to the container.

version: "3"
services:
  gui-service:
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
      - /mnt/wslg:/mnt/wslg
    environment:
      - DISPLAY
      - WAYLAND_DISPLAY
      - XDG_RUNTIME_DIR
      - PULSE_SERVER

When this is done, run docker-compose up gui-service from the WSL terminal.

Extending Docker Compose Service

Other services can extend the gui-service so the configuration does not need to be repeated.

version: "3"
services:
  some-service:
    extends:
      service: gui-service
    command: echo "Hello World!"

When this is done, run docker-compose up some-service from the WSL terminal.

Shared Memory

As explained by this post When ROS2 Discovery detects another node on the same network, it will try to use shared memory to communicate. This is faster than using the network. However, if the nodes are running in different containers, they will not be able to use shared memory. To fix this, the following configuration from this post can be used.

version: "3"
services:
  some-service:
    volumes:
      - /dev/shm/:/dev/shm