Skip to content

Commit e41d1a1

Browse files
committed
Bind shim to localhost
1 parent 1030276 commit e41d1a1

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

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
}

src/dstack/_internal/core/backends/local/compute.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def create_instance(
6060
backend=instance_offer.backend,
6161
instance_type=instance_offer.instance,
6262
instance_id="local",
63-
hostname="127.0.0.1",
63+
hostname="localhost",
6464
internal_ip=None,
6565
region="",
6666
price=instance_offer.price,
@@ -84,7 +84,7 @@ def run_job(
8484
backend=instance_offer.backend,
8585
instance_type=instance_offer.instance,
8686
instance_id="local",
87-
hostname="127.0.0.1",
87+
hostname="localhost",
8888
internal_ip=None,
8989
region="",
9090
price=instance_offer.price,

0 commit comments

Comments
 (0)