Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openhands_cli/gui_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def launch_gui_server(mount_cwd: bool = False, gpu: bool = False) -> None:
docker_cmd.extend(
[
"-p",
"3000:3000",
"127.0.0.1:3000:3000",
"--add-host",
"host.docker.internal:host-gateway",
"--name",
Expand Down
15 changes: 12 additions & 3 deletions tests/test_gui_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,18 @@ class TestFormatDockerCommand:
"Running Docker command: docker run hello-world",
),
(
["docker", "run", "-it", "--rm", "-p", "3000:3000", "openhands:latest"],
[
"docker",
"run",
"-it",
"--rm",
"-p",
"127.0.0.1:3000:3000",
"openhands:latest",
],
(
"Running Docker command: docker run -it --rm -p 3000:3000 "
"openhands:latest"
"Running Docker command: docker run -it --rm -p "
"127.0.0.1:3000:3000 openhands:latest"
),
),
([], "Running Docker command: "),
Expand Down Expand Up @@ -183,6 +191,7 @@ def test_launch_gui_server_scenarios(
assert run_cmd[0:2] == ["docker", "run"]
# Verify --pull=always is in the command
assert "--pull=always" in run_cmd
assert run_cmd[run_cmd.index("-p") + 1] == "127.0.0.1:3000:3000"

if mount_cwd:
assert "SANDBOX_VOLUMES=/current/dir:/workspace:rw" in " ".join(run_cmd)
Expand Down