4 ms·
Every port on the machine, or every port on the container?
by tfehring 5y ago
Every port on the machine, or every port on the container?
- remram 5y agoThe container's ports that you explicitly expose. E.g. `docker run -p 8080:80 nginx` will expose the container's port 80 as port 8080 on the host. That port will be open whether or not the host has a firewall configured to block 8080. You can do `docker run -p 127.0.0.1:8080:80 nginx` to only have the port on the host accessible on the loopback interface (for example if you have a reverse proxy on the host, proxying to 127.0.0.1:8080).