Skip to content

Commit be36bde

Browse files
authored
Bind shim and exposed container ports to localhost (#3057)
1 parent 7b71f53 commit be36bde

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

runner/cmd/shim/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ func start(ctx context.Context, args shim.CLIArgs, serviceMode bool) (err error)
240240
}
241241
}
242242

243-
address := fmt.Sprintf(":%d", args.Shim.HTTPPort)
243+
address := fmt.Sprintf("localhost:%d", args.Shim.HTTPPort)
244244
shimServer := api.NewShimServer(ctx, address, Version, dockerRunner, dcgmExporter, dcgmWrapper)
245245

246246
defer func() {

runner/internal/shim/docker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ func bindPorts(ports []int) nat.PortMap {
982982
for _, port := range ports {
983983
portMap[nat.Port(fmt.Sprintf("%d/tcp", port))] = []nat.PortBinding{
984984
{
985-
HostIP: "0.0.0.0",
985+
HostIP: "127.0.0.1",
986986
HostPort: "", // use ephemeral port from ip_local_port_range
987987
},
988988
}

0 commit comments

Comments
 (0)