I built myself a small PC to play with Docker, on Ubuntu, it works very well. At the same time I have my everyday PC, under Windows 11. I can access my Ubuntu Docker PC via an SSH connection, no worries it works very well.
For information, on my Windows 11 PC, the default gateway is 192.168.1.1.
If I create an nginx container for example, on my Ubuntu, I can access it via localhost:8080 for example. But how do I access it from my Windows 11 PC?
I tried to play with the network settings but without success, I read a lot of tutorials but I didn’t find simple solutions, or I didn’t understand anything
I have the impression that I’m on the wrong way… In fact, I plan to set up a small website in a container and to be able to access it via my public address.
In this case, it is better to “play” with ports and work with port forwarding?
It really depends on how you want to do it.
You could use macvlan to assign an ip from your dhcp directly to the container.
But i think what most people do, is use different ports, and use something in front to route it to the specific container, fx. traefik, Nginx Proxy Manager or another reverse proxy to route, my.domain.com → host/container:8080