mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 05:37:20 +08:00
Pass container port instead of host port to Docker (#12595)
Co-authored-by: Engel Nyst <engel.nyst@gmail.com>
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user