feat(docker): add relay daemon port mapping for container communication

- Introduced a relay daemon port (2099/tcp) to facilitate communication between the host Tai server and containers.
- Updated port bindings to ensure the relay port is always mapped to the host IP for improved connectivity.

Made-with: Cursor
This commit is contained in:
Max 2026-03-15 00:56:30 +08:00
parent 9c9701ed7e
commit de114ade15

View file

@ -52,6 +52,12 @@ func (d *dockerCore) create(ctx context.Context, opts CreateOptions, addVNCPorts
}}
}
// tai relay daemon port — always mapped so the host Tai server can
// forward arbitrary container ports through the relay.
relayPort := nat.Port("2099/tcp")
exposedPorts[relayPort] = struct{}{}
portBindings[relayPort] = []nat.PortBinding{{HostIP: "127.0.0.1", HostPort: ""}}
if opts.VNC {
hostCfg.CapAdd = append(hostCfg.CapAdd, "SYS_ADMIN")
shmSize := opts.Memory / 4