Open The-Michael-Chen opened 1 year ago
Hi @The-Michael-Chen,
Can you provide complete instructions to reproduce?
Is it possible that both the first container and the container that is launched with the docker create
command are both trying to use port 6080 on the host machine?
Hey @Tiryoh . Thank you so so much for offering to help! I make sure to close the container after opening so I don't think two containers are trying to use port 6080 on the host machine. The complete steps to reproduce are as follows:
docker create -it -p 6080:80 --name ros2_example tiryoh/ros2-desktop-vnc:foxy It always works fine the first time. (I've tried it without -it, without the binding, and without the volumes from and it still doesn't work) docker stop ros2_example docker start ros2_example After that, it doesn't work with local host anymore. But, it still works while running in terminal.
Different things I've tried:
lsof -i :6080
before restarting the container, nothing comes up. When running it during the container it only comes up with the correct port mapping. As I mentioned earlier I've also tried various ports. For your information, a friend of mine told me that logging out before stopping the container can avoid the problem. Thanks.
@suzuki-takuo crazy enough that works! Why would that work lmao
could we see this issue get resolved @Tiryoh
@The-Michael-Chen Sorry, I've missed the notification I'm glad to hear that the issue has been resolved!
@suzuki-takuo Thanks for your help!
Once I confirm that the issue and its solution can be reproduced, I'm planning to make an addition to the README.
I was trying to run ros foxy on a docker container. It works fine launching it for the first time, but after I run docker stop container it doesn’t connect anymore to the localhost port. It still works in terminal, but doesn’t work with novnc in the browser.
The command I ran to initialize it was docker create -it -p 6080:80 -v $(pwd):/home/ubuntu/Desktop/yondu_ros --name ros2_gazebo --volumes-from ros2_practice tiryoh/ros2-desktop-vnc:foxy
I'm running it on MacOS Ventura 13.1
I’m not getting any errors except on the browser where it says “failed to connect to server”