Hi all. I have the following
- OS: Ubuntu 22.04.1 LTS, kernel 5.15
- Docker version: 20.10.21
I create a network with
docker network create net_test
*docker run -d --name srvr_tester --network=*net_test python:3.8 python -m http.server 443
then from outside I tried to run
curl -X ‘GET’ --insecure http://192.168.192.13:443/etc/resolv.conf
and it goes in timeout.
I ve been checking FW and IPTABLES but still nothing.
Can you elaborate, why this should work?
Assumed 192.168.192.13 is the docker host’s ip, then the behavior is correct.
If you want a container to be reachable on a host network port, you need to publish it:
Here is the command that I run.
docker run -d -p 443:8000 --name srvr_tester --network=net_test python:3.8 python -m http.server 8000
Since you shared a different command does that mean you solved the issue by publishing the port?
it was my mistake posting the wrng command so still not working.
It looks like the request arrive at the eth0 device but it’s not passed on neither to the docker bridge or veth interface.
Some setting on the kernel that I am missing
- you are using the right port number (the port on the left side in the docker command)
- and there is no firewall blocking the request
- and you have the same port in the docker command on the left side as the application is listening on inside
your request should work.
- How and what did you check exactly?
- Do you have any firewall in front of the destinations server?
- Can you successfully run the curl comand on the server using the same IP that you want to access remotely?
- Have you tried to disable ufw on the server just for testing (if it is not a public, production server)
sudo ufw disable