Pass container port instead of host port to Docker (#12595)

Co-authored-by: Engel Nyst <engel.nyst@gmail.com>
This commit is contained in:
Chris Bagwell
2026-02-28 10:45:16 -06:00
committed by GitHub
parent f6f6c1ab25
commit f9d553d0bb

View File

@@ -162,7 +162,7 @@ class DockerSandboxService(SandboxService):
ExposedUrl(
name=exposed_port.name,
url=url,
port=host_port,
port=exposed_port.container_port,
)
)
else:
@@ -193,7 +193,7 @@ class DockerSandboxService(SandboxService):
ExposedUrl(
name=matching_port.name,
url=url,
port=host_port,
port=matching_port.container_port,
)
)
@@ -387,7 +387,7 @@ class DockerSandboxService(SandboxService):
for exposed_port in self.exposed_ports:
host_port = self._find_unused_port()
port_mappings[exposed_port.container_port] = host_port
env_vars[exposed_port.name] = str(host_port)
env_vars[exposed_port.name] = str(exposed_port.container_port)
# Prepare labels
labels = {