Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Commit 86abe2e

Browse files
authored
Merge pull request #76 from doringeman/ports-docs
install-runner: Document both default ports for Moby and Cloud
2 parents cf549c5 + 26445c3 commit 86abe2e

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

commands/install-runner.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,12 @@ func newInstallRunner() *cobra.Command {
179179
return nil
180180
}
181181

182+
if port == 0 {
183+
// Use "0" as a sentinel default flag value so it's not displayed automatically.
184+
// The default values are written in the usage string.
185+
// Hence, the user currently won't be able to set the port to 0 in order to get a random available port.
186+
port = standalone.DefaultControllerPortMoby
187+
}
182188
// HACK: If we're in a Cloud context, then we need to use a
183189
// different default port because it conflicts with Docker Desktop's
184190
// default model runner host-side port. Unfortunately we can't make
@@ -248,8 +254,8 @@ func newInstallRunner() *cobra.Command {
248254
},
249255
ValidArgsFunction: completion.NoComplete,
250256
}
251-
c.Flags().Uint16Var(&port, "port", standalone.DefaultControllerPortMoby,
252-
"Docker container port for Docker Model Runner")
257+
c.Flags().Uint16Var(&port, "port", 0,
258+
"Docker container port for Docker Model Runner (default: 12434 for Docker CE, 12435 for Cloud mode)")
253259
c.Flags().StringVar(&gpuMode, "gpu", "auto", "Specify GPU support (none|auto|cuda)")
254260
c.Flags().BoolVar(&doNotTrack, "do-not-track", false, "Do not track models usage in Docker Model Runner")
255261
return c

docs/reference/docker_model_install-runner.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ options:
2828
swarm: false
2929
- option: port
3030
value_type: uint16
31-
default_value: "12434"
32-
description: Docker container port for Docker Model Runner
31+
default_value: "0"
32+
description: |
33+
Docker container port for Docker Model Runner (default: 12434 for Docker CE, 12435 for Cloud mode)
3334
deprecated: false
3435
hidden: false
3536
experimental: false

docs/reference/model_install-runner.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Install Docker Model Runner (Docker Engine only)
55

66
### Options
77

8-
| Name | Type | Default | Description |
9-
|:-----------------|:---------|:--------|:-------------------------------------------------|
10-
| `--do-not-track` | `bool` | | Do not track models usage in Docker Model Runner |
11-
| `--gpu` | `string` | `auto` | Specify GPU support (none\|auto\|cuda) |
12-
| `--port` | `uint16` | `12434` | Docker container port for Docker Model Runner |
8+
| Name | Type | Default | Description |
9+
|:-----------------|:---------|:--------|:---------------------------------------------------------------------------------------------------|
10+
| `--do-not-track` | `bool` | | Do not track models usage in Docker Model Runner |
11+
| `--gpu` | `string` | `auto` | Specify GPU support (none\|auto\|cuda) |
12+
| `--port` | `uint16` | `0` | Docker container port for Docker Model Runner (default: 12434 for Docker CE, 12435 for Cloud mode) |
1313

1414

1515
<!---MARKER_GEN_END-->

pkg/standalone/ports.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ const (
55
// controller will listen for requests in Moby environments.
66
DefaultControllerPortMoby = 12434
77
// DefaultControllerPortCloud is the default TCP port on which the
8-
// standalone controller will listen for requests in Moby environments.
8+
// standalone controller will listen for requests in Cloud environments.
99
DefaultControllerPortCloud = 12435
1010
)

0 commit comments

Comments
 (0)