Docker Windows container communication
Hi all,
let's structure this in [Background], [Facts] and [Problem]. Feel free to only read problem.
Background:
- I must use Windows 10 from company
- Docker backend is WSL2
- Development is later deployed to Raspberry Pi
- ROS Noetic Container works fine
- Every application has its own container
- Until now, my network was set to "host" which reportedly not works under Windows
- I want to run rviz which is poorly slow from inside the container like this Guide, so I installed Noetic under Windows
Facts:
- All container are able to communicate without any setup
- Communication from/to Windows is not possible
Problem: now for the really fun thing
- Running roscore on Windows and trying to connect from container does sometimes work: if I specify ROS_MASTER_URI=http://host.docker.internal:11311/ and ROS_HOSTNAME=host.docker.internal, then start rqt it works. From within the container I can do other things like rostopic and so on...
- Another container, same setup, trying to start my usual app via roslaunch does not work
- Launching roscore in container, running rostopic on Windows does nothing at first. Later I changed network from "host" to "bridge" and enable forwarding of port 11311, now being able to do rostopic.
- Being able to see topics, I naively launch rviz on Windows. -> No topic nor translation is received.
- As this is how I intend to proceed: Do I have to forward every port from now on or are there better solutions? Also, it's quite tedious to set up the ROS_MASTER_URI for all the containers... which only happens since I set network to "bridge" and they got their own IP
Cheers, aur20
In general on this site, we only "close" questions that are duplicates or if there is something else wrong with them. My opinion is that you should re-open it.