Skip to content

Commit 9a9adfa

Browse files
Add info about port binding controls (Desktop 4.52) (#23737)
<!--Delete sections as needed --> ## Description Adds information on the new port binding settings that are going into Docker Desktop 4.52, including a brief description of how it works, and information about settings management. <!-- Tell us what you did and why --> ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Technical review - [x] Editorial review - [ ] Product review --------- Co-authored-by: Allie Sadler <[email protected]>
1 parent 1b74857 commit 9a9adfa

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

content/manuals/desktop/features/networking/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ For example, with `docker run -p 80:80 nginx`:
6161
- Inside the VM, the connection is routed to the container’s internal IP address and port, for example `172.17.0.2:80`.
6262
- The container responds through the same path, so you can access it from your host just like any other local service.
6363

64-
By default, `docker run -p` listens on all network interfaces (`0.0.0.0`), but you can restrict it to a specific address, such as `127.0.0.1` (localhost) or a particular network adapter.
64+
By default, `docker run -p` listens on all network interfaces (`0.0.0.0`), but you can restrict it to a specific address, such as `127.0.0.1` (`localhost`) or a particular network adapter. This behavior can be modified to bind to `localhost` by default in [Docker Desktop's network settings](/manuals/desktop/settings-and-maintenance/settings.md#network)
6565

6666
Host firewalls can permit or deny inbound connections by filtering on `com.docker.backend`.
6767

content/manuals/desktop/settings-and-maintenance/settings.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ On Windows and Mac, you can also set the default networking mode and DNS resolut
315315

316316
On Mac, you can also select the **Use kernel networking for UDP** setting. This lets you use a more efficient kernel networking path for UDP. This may not be compatible with your VPN software.
317317

318+
You can also define the behavior of port bindings. By default Docker Desktop binds all ports on containers to `0.0.0.0` on the host, though this can be overridden by providing a specific IP. You can change this default behavior by changing the **Port binding behavior** setting, allowing you to either bind to `localhost` (`127.0.0.1`) by default, or only allow containers to bind to `localhost` under any circumstances, even if requested otherwise.
319+
318320
### WSL Integration
319321

320322
On Windows in WSL 2 mode, you can configure which WSL 2 distributions will have the Docker
@@ -534,4 +536,4 @@ Use the **Docker Offload** tab to:
534536
- Toggle **Enable Docker Offload**. When enabled, you can start Offload sessions.
535537
- Select **Idle timeout**. This is the duration of time between no activity and Docker Offload entering idle mode.For
536538
details about idle timeout, see [Active and idle states](../../offload/configuration.md#understand-active-and-idle-states)
537-
- Check **Enable GPU support**. When enabled, workloads can use cloud GPU if available.
539+
- Check **Enable GPU support**. When enabled, workloads can use cloud GPU if available.

content/manuals/enterprise/security/hardened-desktop/settings-management/configure-json-file.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ The following sample is an `admin-settings.json` file with common enterprise set
239239
"enableInferenceGPUVariant": {
240240
"locked": true,
241241
"value": true
242+
},
243+
"portBindingBehavior": {
244+
"locked": true,
245+
"value": "default-port-binding"
242246
}
243247
}
244248
```
@@ -357,6 +361,7 @@ The following tables describe all available settings in the `admin-settings.json
357361
|:-------------------------------|---|:-------------------------------|---|
358362
| `defaultNetworkingMode` | Windows and Mac only | Defines the default IP protocol for new Docker networks: `dual-stack` (IPv4 + IPv6, default), `ipv4only`, or `ipv6only`. | Docker Desktop version 4.43 and later. |
359363
| `dnsInhibition` | Windows and Mac only | Controls DNS record filtering returned to containers. Options: `auto` (recommended), `ipv4`, `ipv6`, `none`| Docker Desktop version 4.43 and later. |
364+
| `portBindingBehavior` | Linux-based containers only | Defines port binding restrictions and default behavior, allowing admins to control how a user exposes ports from their containers. Options: `default-port-binding`, `default-local-port-binding`, `local-only-port-binding` | Docker Desktop version 4.52 and later. |
360365

361366
For more information, see [Networking](/manuals/desktop/features/networking.md#networking-mode-and-dns-behaviour-for-mac-and-windows).
362367

0 commit comments

Comments
 (0)