Docker --net=host does not forward ports
On my local machine setting
--net=host on a container makes the container visible on any ports it is using. On a Docker Ubuntu 16.04 droplet the port is not accessible with
docker run -p 8000:8000 -it python python -m http.server
This does not work:
docker run --net=host -p 8000:8000 -it python python -m http.server
How can I make the ports of the container application exposed with
docker run --net=host ...?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.