[Docker Administration] [Part V.B] Docker Networking - Host

Published: by Creative Commons Licence

Host Network

Running nginx

sudo docker run --rm -itd --network host --name my_nginx nginx

Show Container Status

sudo docker container ls

we can not see port binding in level container, port will be attahed in your host.

verify with

ss -tulpn | grep 80

Output:

tcp     LISTEN   0        511              0.0.0.0:80            0.0.0.0:*       users:(("nginx",pid=19858,fd=6),("nginx",pid=19844,fd=6))     

Test with curl

curl http://localhost

Remove Container

sudo docker container rm my_nginx