Skip to content
Draft
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
14 changes: 9 additions & 5 deletions crates/reach-cli/src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ impl Labels {
// Docker client
// ═══════════════════════════════════════════════════════════

/// Host address published sandbox ports bind to. Loopback only: noVNC and the
/// supervisor API give full control of the sandbox and have no auth.
pub const HOST_BIND_ADDR: &str = "127.0.0.1";

pub struct DockerClient {
client: bollard::Docker,
}
Expand All @@ -232,36 +236,36 @@ impl DockerClient {
map.insert(
"5900/tcp".into(),
Some(vec![PortBinding {
host_ip: Some("0.0.0.0".into()),
host_ip: Some(HOST_BIND_ADDR.into()),
host_port: Some(config.ports.vnc.to_string()),
}]),
);
map.insert(
"6080/tcp".into(),
Some(vec![PortBinding {
host_ip: Some("0.0.0.0".into()),
host_ip: Some(HOST_BIND_ADDR.into()),
host_port: Some(config.ports.novnc.to_string()),
}]),
);
map.insert(
"8400/tcp".into(),
Some(vec![PortBinding {
host_ip: Some("0.0.0.0".into()),
host_ip: Some(HOST_BIND_ADDR.into()),
host_port: Some(config.ports.health.to_string()),
}]),
);
map.insert(
"8401/tcp".into(),
Some(vec![PortBinding {
host_ip: Some("0.0.0.0".into()),
host_ip: Some(HOST_BIND_ADDR.into()),
host_port: Some(config.ports.browserd.to_string()),
}]),
);
for (host_port, container_port) in &config.ports.extra {
map.insert(
format!("{container_port}/tcp"),
Some(vec![PortBinding {
host_ip: Some("0.0.0.0".into()),
host_ip: Some(HOST_BIND_ADDR.into()),
host_port: Some(host_port.to_string()),
}]),
);
Expand Down
Loading