I am getting an error: Error: cannot listen on the TCP port: listen tcp4 :53: bind: address already in use When creating a container that gets his own IP address, this means that regardless of if there is some host program listening at port 53 the container should have no problems listening in the same port because his IP is not the same as the Host.
The command I am using to start the container is the following: sudo podman run -d --network podnet -p 53:53 --name test-container test-image
And inspecting the network podnet with sudo podman inspect podnet give the following:
[ { "name": "podnet", "id": "<censored>", "driver": "macvlan", "network_interface": "bridge0", "created": "<censored>", "ipv6_enabled": false, "internal": false, "dns_enabled": false, "options": { "mode": "passthru" }, "ipam_options": { "driver": "dhcp" } } ] I am in a OpenSUSE Leap Micro machine.
-p(--publish) option which attaches the port to your host machine (using all interfaces by default). It sounds like your host machine already has port 53 in use. Does it work if you remove the-poption?dig google.com @localhostin an exec session in the container it only gives me the error:;; communications error to ::1#53: connection refusedexecsession would have nothing to do with using--publish. If it cannot run in theexecsession, then it is not working. You should post an example Dockerfile showing your problem to help troubleshoot this issue.