Merge pull request #22602 from robmry/moby_28_firewalling

Remote access to container ports
This commit is contained in:
Sebastiaan van Stijn 2025-05-08 10:21:11 +02:00 committed by GitHub
commit d8b9d357d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -160,8 +160,8 @@ Here are some examples:
>
> > [!WARNING]
> >
> > Hosts within the same L2 segment (for example, hosts connected to the same
> > network switch) can reach ports published to localhost.
> > In releases older than 28.0.0, hosts within the same L2 segment (for example,
> > hosts connected to the same network switch) can reach ports published to localhost.
> > For more information, see
> > [moby/moby#45610](https://github.com/moby/moby/issues/45610)

View File

@ -234,14 +234,14 @@ $ docker run --network=mynet -p 8080:80 myimage
```
Then:
- Only container port 80 will be open, for IPv4 and IPv6. It is accessible
from anywhere, if there is routing to the container's address, and access
is not blocked by the host's firewall.
- Only container port 80 will be open, for IPv4 and IPv6.
- For IPv6, using `routed` mode, port 80 will be open on the container's IP
address. Port 8080 will not be opened on the host's IP addresses, and
outgoing packets will use the container's IP address.
- For IPv4, using the default `nat` mode, the container's port 80 will be
accessible via port 8080 on the host's IP addresses, as well as directly.
accessible via port 8080 on the host's IP addresses, as well as directly
from within the Docker host. But, container port 80 cannot be accessed
directly from outside the host.
Connections originating from the container will masquerade, using the
host's IP address.