Skip to content

Commit 81c5cf9

Browse files
authored
Merge pull request #22914 from ArthurFlag/AIE-230-docs-cors-config-in-dd
CORS support
1 parent 7c860c5 commit 81c5cf9

File tree

3 files changed

+55
-17
lines changed

3 files changed

+55
-17
lines changed

content/manuals/ai/model-runner/_index.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,25 @@ Models are pulled from Docker Hub the first time they're used and stored locally
9090

9191
### Enable DMR in Docker Desktop
9292

93-
1. Navigate to the **Beta features** tab in settings.
94-
2. Tick the **Enable Docker Model Runner** setting.
95-
3. If you are running on Windows with a supported NVIDIA GPU, you should also see and be able to tick the **Enable GPU-backed inference** setting.
93+
1. In the settings view, navigate to the **Beta features** tab.
94+
1. Tick the **Enable Docker Model Runner** setting.
95+
1. If you are running on Windows with a supported NVIDIA GPU, you should also see and be able to tick the **Enable GPU-backed inference** setting.
96+
1. Optional: If you want to enable TCP support, select the **Enable host-side TCP support**
97+
1. In the **Port** field, type the port of your choice.
98+
1. If you are interacting with Model Runner from a local frontend web app,
99+
in **CORS Allows Origins**, select the origins that Model Runner should accept requests from.
100+
An origin is the URL where your web app is running, for example `http://localhost:3131`.
96101

97102
You can now use the `docker model` command in the CLI and view and interact with your local models in the **Models** tab in the Docker Desktop Dashboard.
98103

99104
> [!IMPORTANT]
100105
>
101-
> For Docker Desktop versions 4.41 and earlier, this settings lived under the **Experimental features** tab on the **Features in development** page.
106+
> For Docker Desktop versions 4.41 and earlier, this setting lived under the **Experimental features** tab on the **Features in development** page.
102107
103108
### Enable DMR in Docker Engine
104109

105110
1. Ensure you have installed [Docker Engine](/engine/install/).
106-
2. DMR is available as a package. To install it, run:
111+
1. DMR is available as a package. To install it, run:
107112

108113
{{< tabs >}}
109114
{{< tab name="Ubuntu/Debian">}}
@@ -124,13 +129,19 @@ You can now use the `docker model` command in the CLI and view and interact with
124129
{{< /tab >}}
125130
{{< /tabs >}}
126131

127-
3. Test the installation:
132+
1. Test the installation:
128133

129134
```console
130135
$ docker model version
131136
$ docker model run ai/smollm2
132137
```
133138

139+
1. Optional: To enable TCP support, set the port with the `DMR_RUNNER_PORT` environment variable.
140+
1. Optional: If you enabled TCP support, you can configure CORS allowed origins with the `DMR_ORIGINS` environment variable. Possible values are:
141+
- `*`: Allow all origins
142+
- Comma-separated list of allowed origins
143+
- When unspecified, all origins are denied.
144+
134145
## Pull a model
135146

136147
Models are cached locally.

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,16 @@ For more information, see [Networking](/manuals/desktop/features/networking.md#n
312312
>
313313
> For Docker Desktop versions 4.41 and earlier, some of these settings lived under the **Experimental features** tab on the **Features in development** page.
314314
315-
| Parameter | OS | Description | Version |
316-
|:----------------------------|----|:--------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|
317-
| `allowBetaFeatures` | | If `value` is set to `true`, beta features are enabled. | |
318-
| `enableDockerAI` | | If `allowBetaFeatures` is true, setting `enableDockerAI` to `true` enables [Docker AI (Ask Gordon)](/manuals/ai/gordon/_index.md) by default. You can independently control this setting from the `allowBetaFeatures` setting. | |
319-
| `enableInference` | | If `allowBetaFeatures` is true, setting `enableInference` to `true` enables [Docker Model Runner](/manuals/ai/model-runner/_index.md) by default. You can independently control this setting from the `allowBetaFeatures` setting. | |
320-
| &nbsp; &nbsp; &nbsp; &nbsp; `enableInferenceTCP` | | Enable host-side TCP support. This setting requires Docker Model Runner setting to be enabled first. | |
321-
| `enableDockerMCPToolkit` | | If `allowBetaFeatures` is true, setting `enableDockerMCPToolkit` to `true` enables the [MCP toolkit feature](/manuals/ai/mcp-catalog-and-toolkit/toolkit.md) by default. You can independently control this setting from the `allowBetaFeatures` setting. | |
322-
| `allowExperimentalFeatures` | | If `value` is set to `true`, experimental features are enabled. | Docker Desktop version 4.41 and earlier |
315+
| Parameter | OS | Description | Version |
316+
|:-----------------------------------------------------|----|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|
317+
| `allowBetaFeatures` | | If `value` is set to `true`, beta features are enabled. | |
318+
| `enableDockerAI` | | If `allowBetaFeatures` is true, setting `enableDockerAI` to `true` enables [Docker AI (Ask Gordon)](/manuals/ai/gordon/_index.md) by default. You can independently control this setting from the `allowBetaFeatures` setting. | |
319+
| `enableInference` | | If `allowBetaFeatures` is true, setting `enableInference` to `true` enables [Docker Model Runner](/manuals/ai/model-runner/_index.md) by default. You can independently control this setting from the `allowBetaFeatures` setting. | |
320+
| &nbsp; &nbsp; &nbsp; &nbsp; `enableInferenceTCP` | | Enable host-side TCP support. This setting requires Docker Model Runner setting to be enabled first. | |
321+
| &nbsp; &nbsp; &nbsp; &nbsp; `enableInferenceTCPPort` | | Specifies the exposed TCP port. This setting requires Docker Model Runner setting to be enabled first. | |
322+
| &nbsp; &nbsp; &nbsp; &nbsp; `enableInferenceCORS` | | Specifies the allowed CORS origins. Empty string to deny all,`*` to accept all, or a list of comma-separated values. This setting requires Docker Model Runner setting to be enabled first. | |
323+
| `enableDockerMCPToolkit` | | If `allowBetaFeatures` is true, setting `enableDockerMCPToolkit` to `true` enables the [MCP toolkit feature](/manuals/ai/mcp-catalog-and-toolkit/toolkit.md) by default. You can independently control this setting from the `allowBetaFeatures` setting. | |
324+
| `allowExperimentalFeatures` | | If `value` is set to `true`, experimental features are enabled. | Docker Desktop version 4.41 and earlier |
323325

324326
### Enhanced Container Isolation
325327

content/manuals/security/for-admins/hardened-desktop/settings-management/settings-reference.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ third-party or unvetted plugins from being installed.
795795
- **Beta** settings in [Docker Desktop GUI](/manuals/desktop/settings-and-maintenance/settings.md)
796796
- Settings Management: `enableDockerAI` setting in the [`admin-settings.json` file](/manuals/security/for-admins/hardened-desktop/settings-management/configure-json-file.md)
797797

798-
### Enable host-side TCP support
798+
#### Enable host-side TCP support
799799

800800
| Default value | Accepted values | Format |
801801
|---------------|-----------------|----------|
@@ -808,11 +808,36 @@ third-party or unvetted plugins from being installed.
808808
- **Beta** settings in [Docker Desktop GUI](/manuals/desktop/settings-and-maintenance/settings.md)
809809
- Settings Management: `enableDockerAI` setting in the [`admin-settings.json` file](/manuals/security/for-admins/hardened-desktop/settings-management/configure-json-file.md)
810810

811-
812811
> [!NOTE]
813812
>
814813
> This setting requires Docker Model Runner setting to be enabled first.
815814
815+
##### Port
816+
817+
| Default value | Accepted values | Format |
818+
|---------------|-----------------|---------|
819+
| 12434 | Integer | Integer |
820+
821+
- **Description:** Specifies the exposed TCP port.
822+
- **OS:** {{< badge color=blue text="All" >}}
823+
- **Use case:** Connect to the Model Runner via TCP.
824+
- **Configure this setting with:**
825+
- **Beta features** settings in [Docker Desktop GUI](/manuals/desktop/settings-and-maintenance/settings.md)
826+
- Settings Management: `enableInferenceTCP` setting in the [`admin-settings.json` file](/manuals/security/for-admins/hardened-desktop/settings-management/configure-json-file.md)
827+
828+
##### CORS Allowed Origins
829+
830+
| Default value | Accepted values | Format |
831+
|---------------|---------------------------------------------------------------------------------|--------|
832+
| Empty string | Empty string to deny all,`*` to accept all, or a list of comma-separated values | String |
833+
834+
- **Description:** Specifies the allowed CORS origins.
835+
- **OS:** {{< badge color=blue text="All" >}}
836+
- **Use case:** Integration with a web app.
837+
- **Configure this setting with:**
838+
- **Beta features** settings in [Docker Desktop GUI](/manuals/desktop/settings-and-maintenance/settings.md)
839+
- Settings Management: `enableInferenceCORS` setting in the [`admin-settings.json` file](/manuals/security/for-admins/hardened-desktop/settings-management/configure-json-file.md)
840+
816841
### Enable Docker MCP Toolkit
817842

818843
| Default value | Accepted values | Format |
@@ -1127,4 +1152,4 @@ overrides are possible.
11271152
- **OS:** {{< badge color=blue text="All" >}}
11281153
- **Use case:** Allow users to authenticate with enterprise proxy servers that require Kerberos or NTLM.
11291154
- **Configure this setting with:**
1130-
- Settings Management: `proxy.enableKerberosNtlm` in the [`admin-settings.json` file](/manuals/security/for-admins/hardened-desktop/settings-management/configure-json-file.md)
1155+
- Settings Management: `proxy.enableKerberosNtlm` in the [`admin-settings.json` file](/manuals/security/for-admins/hardened-desktop/settings-management/configure-json-file.md)

0 commit comments

Comments
 (0)