@@ -127,12 +127,13 @@ func ensureStandaloneRunnerAvailable(ctx context.Context, printer standalone.Sta
127127
128128 // Create the model runner container.
129129 port := uint16 (standalone .DefaultControllerPortMoby )
130+ host := "127.0.0.1"
130131 environment := "moby"
131132 if engineKind == types .ModelRunnerEngineKindCloud {
132133 port = standalone .DefaultControllerPortCloud
133134 environment = "cloud"
134135 }
135- if err := standalone .CreateControllerContainer (ctx , dockerClient , port , environment , false , gpu , modelStorageVolume , printer , engineKind ); err != nil {
136+ if err := standalone .CreateControllerContainer (ctx , dockerClient , port , host , environment , false , gpu , modelStorageVolume , printer , engineKind ); err != nil {
136137 return nil , fmt .Errorf ("unable to initialize standalone model runner container: %w" , err )
137138 }
138139
@@ -159,6 +160,7 @@ func ensureStandaloneRunnerAvailable(ctx context.Context, printer standalone.Sta
159160
160161func newInstallRunner () * cobra.Command {
161162 var port uint16
163+ var host string
162164 var gpuMode string
163165 var doNotTrack bool
164166 c := & cobra.Command {
@@ -245,7 +247,7 @@ func newInstallRunner() *cobra.Command {
245247 return fmt .Errorf ("unable to initialize standalone model storage: %w" , err )
246248 }
247249 // Create the model runner container.
248- if err := standalone .CreateControllerContainer (cmd .Context (), dockerClient , port , environment , doNotTrack , gpu , modelStorageVolume , cmd , engineKind ); err != nil {
250+ if err := standalone .CreateControllerContainer (cmd .Context (), dockerClient , port , host , environment , doNotTrack , gpu , modelStorageVolume , cmd , engineKind ); err != nil {
249251 return fmt .Errorf ("unable to initialize standalone model runner container: %w" , err )
250252 }
251253
@@ -256,6 +258,7 @@ func newInstallRunner() *cobra.Command {
256258 }
257259 c .Flags ().Uint16Var (& port , "port" , 0 ,
258260 "Docker container port for Docker Model Runner (default: 12434 for Docker CE, 12435 for Cloud mode)" )
261+ c .Flags ().StringVar (& host , "host" , "127.0.0.1" , "Host address to bind Docker Model Runner" )
259262 c .Flags ().StringVar (& gpuMode , "gpu" , "auto" , "Specify GPU support (none|auto|cuda)" )
260263 c .Flags ().BoolVar (& doNotTrack , "do-not-track" , false , "Do not track models usage in Docker Model Runner" )
261264 return c
0 commit comments