Docker: Access Host Ports

Sometimes you may want to access ports on your host from within a container. This is easily done by looking a the destination of the network gateway 0.0.0.0:

You can now use this address. For example if the host were running a web server, you could access it from within a container with

If netstat is installed via net-tools ($ apt install net-tools).

 

Leave a Reply

Your email address will not be published. Required fields are marked *