I run;
systemd-nspawn -n -p 80:80 -bD /path/to/httpd-container
In the container, httpd works. However, accessing from host, it dose not access. In addition, the below works without network options;
systemd-nspawn -bD /path/to/httpd-container
What do I need to use option -n
, --network-veth
and -p
, --port
?
Same question here; in order to help others reproduce from scratch:
Preparation
pull a mundane image from the internet
Test 1
Run a server inside a container with no networking option
in another window
works
Test 2
Enabling private networking and port mapping, so that host port 10000 is mapped to container port 20000
but then
results in
Why it's wrong
I would almost have expected exactly opposite results; in any case the second test is the use case that I'd like to get to work. I really need my containers to be network-isolated, and need port redirection in any case as all the containers run their service on the same port, which need to be redirected to a range of ports on the host side.
What I've tried
Adding the option
--network-interface=eno1
(my public interface) to the mix has not helpedWhat puzzles me
My host runs fedora25 with selinux disabled; still I can see these messages when firing the container, which I take it are unrelated, but are they ?