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

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 *

This site uses Akismet to reduce spam. Learn how your comment data is processed.