Skip to content

monoceros tunnel

Opens a TCP tunnel from the host into the container - for DB clients, ad-hoc port forwards, or any tool that needs a container-internal port. It is a foreground process: Ctrl+C stops the tunnel.

Terminal window
monoceros tunnel <name> <service-or-port> [--local-port=<n>] [--local-address=<addr>]

<service-or-port> is a service name from the yml (postgres), a service:port pair for an explicit in-container port (rustfs:9001), or a bare in-container port that resolves to the workspace (8080).

Terminal window
# Reach the Postgres service from a host DB client (localhost:5432)
monoceros tunnel acme postgres
# A bare port, bound to a different local port when 5432 is busy
monoceros tunnel acme 5432 --local-port=55432
# Expose on the LAN instead of loopback only
monoceros tunnel acme postgres --local-address=0.0.0.0
  • --local-port=<n> - host port the tunnel listens on. Defaults to the same as the in-container port (e.g. postgres5432); set another when that is busy.
  • --local-address=<addr> - host interface to bind. Defaults to 127.0.0.1 (loopback, same machine only); pass 0.0.0.0 to reach it from other devices on your network.
  • Foreground. The tunnel lives only as long as the command runs; Ctrl+C closes it.
  • Raw TCP, not HTTP. For browser-facing HTTP services use the proxy hostnames from monoceros port instead.