Skip to content

Commit 75be694

Browse files
committed
install-runner: Document both default ports for Moby and Cloud
Use "0" as a sentinel default flag value so it's not displayed automatically. The default values are written in the usage string. Hence, the user currently won't be able to set the port to 0 in order to get a random available port. Signed-off-by: Dorin Geman <dorin.geman@docker.com>
1 parent 29629ec commit 75be694

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

cmd/cli/commands/install-runner.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ func newInstallRunner() *cobra.Command {
130130
return nil
131131
}
132132

133+
if port == 0 {
134+
// Use "0" as a sentinel default flag value so it's not displayed automatically.
135+
// The default values are written in the usage string.
136+
// Hence, the user currently won't be able to set the port to 0 in order to get a random available port.
137+
port = standalone.DefaultControllerPortMoby
138+
}
133139
// HACK: If we're in a Cloud context, then we need to use a
134140
// different default port because it conflicts with Docker Desktop's
135141
// default model runner host-side port. Unfortunately we can't make
@@ -193,8 +199,8 @@ func newInstallRunner() *cobra.Command {
193199
},
194200
ValidArgsFunction: completion.NoComplete,
195201
}
196-
c.Flags().Uint16Var(&port, "port", standalone.DefaultControllerPortMoby,
197-
"Docker container port for Docker Model Runner")
202+
c.Flags().Uint16Var(&port, "port", 0,
203+
"Docker container port for Docker Model Runner (default: 12434 for Docker CE, 12435 for Cloud mode)")
198204
c.Flags().StringVar(&gpuMode, "gpu", "auto", "Specify GPU support (none|auto|cuda)")
199205
c.Flags().BoolVar(&doNotTrack, "do-not-track", false, "Do not track models usage in Docker Model Runner")
200206
return c

cmd/cli/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

cmd/cli/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-->

0 commit comments

Comments
 (0)