@@ -266,7 +266,7 @@ func (c *Client) createMcpContainer(ctx context.Context, name string, networkNam
266
266
// Create host configuration
267
267
hostConfig := & container.HostConfig {
268
268
Mounts : convertMounts (permissionConfig .Mounts ),
269
- NetworkMode : container . NetworkMode ( permissionConfig . NetworkMode ) ,
269
+ NetworkMode : "" ,
270
270
CapAdd : permissionConfig .CapAdd ,
271
271
CapDrop : permissionConfig .CapDrop ,
272
272
SecurityOpt : permissionConfig .SecurityOpt ,
@@ -292,12 +292,15 @@ func (c *Client) createMcpContainer(ctx context.Context, name string, networkNam
292
292
// create mcp container
293
293
internalEndpointsConfig := map [string ]* network.EndpointSettings {}
294
294
if isolateNetwork {
295
- internalEndpointsConfig [networkName ] = & network.EndpointSettings {}
295
+ internalEndpointsConfig [networkName ] = & network.EndpointSettings {
296
+ NetworkID : networkName ,
297
+ }
296
298
} else {
297
299
// for other workloads such as inspector, add to external network
298
- internalEndpointsConfig ["toolhive-external" ] = & network.EndpointSettings {}
300
+ internalEndpointsConfig ["toolhive-external" ] = & network.EndpointSettings {
301
+ NetworkID : "toolhive-external" ,
302
+ }
299
303
}
300
-
301
304
containerId , err := c .createContainer (ctx , name , config , hostConfig , internalEndpointsConfig )
302
305
if err != nil {
303
306
return "" , fmt .Errorf ("failed to create container: %v" , err )
0 commit comments