mirror of
https://github.com/docker/docs.git
synced 2026-11-04 10:01:00 +00:00
Vendor the checked-in CLI YAML from Docker Sandboxes release/v0.51 at 7d55286de0c7. This updates command help, adds `sbx policy check http`, and replaces seven agent-specific create pages with redirects to `sbx create`. Validation: full site build with Hugo 0.169.0; upstream byte-for-byte comparison; all 115 command pages, reference links, and seven redirects checked; template formatting and whitespace checks passed.
89 lines
3.4 KiB
YAML
89 lines
3.4 KiB
YAML
name: sbx ports
|
|
synopsis: Manage sandbox port publishing
|
|
description: |-
|
|
Manage sandbox port publishing.
|
|
|
|
List, publish, or unpublish sandbox ports. Publishing a local port starts a
|
|
stopped sandbox before creating the host binding. Without --publish or
|
|
--unpublish flags, lists all published ports.
|
|
|
|
Port spec format: [[HOST_IP:]HOST_PORT:]SANDBOX_PORT[/PROTOCOL]
|
|
If HOST_PORT is omitted, an ephemeral port is allocated automatically.
|
|
If HOST_IP is omitted, the port is bound on loopback, expanded based on
|
|
PROTOCOL and the sandbox's address families: tcp/udp binds both 127.0.0.1
|
|
and ::1 (or only 127.0.0.1 if the sandbox is IPv4-only); tcp4/udp4 binds
|
|
only 127.0.0.1; tcp6/udp6 binds only ::1.
|
|
Supported protocols: tcp, tcp4, tcp6, udp, udp4, udp6.
|
|
|
|
When publishing without a PROTOCOL, tcp4 is used — so a sandbox service
|
|
listening only on IPv4 is reachable without a host client having to avoid
|
|
::1 — or tcp6 when HOST_IP is an IPv6 address. Publish tcp explicitly to
|
|
bind both families.
|
|
|
|
When unpublishing without a PROTOCOL, the mapping is removed whether it was
|
|
published with that same default or as dual-stack tcp. Name the protocol to
|
|
remove a tcp6 or udp mapping; anything left behind is reported.
|
|
|
|
With --cloud:
|
|
Manage the exposed ports of a cloud sandbox.
|
|
|
|
List, publish, or unpublish ports on a cloud sandbox given by ID (sbx_*) or
|
|
name. Without --publish or --unpublish flags, lists the exposed ports.
|
|
|
|
A port is the sandbox port number alone or with a /tcp suffix; UDP and host
|
|
bindings are refused. The cloud control plane assigns a publicly reachable URL
|
|
for each exposed port.
|
|
usage: sbx ports SANDBOX [flags]
|
|
options:
|
|
- name: format
|
|
usage: 'Output format: table, json or yaml'
|
|
- name: help
|
|
shorthand: h
|
|
default_value: "false"
|
|
usage: help for ports
|
|
- name: json
|
|
default_value: "false"
|
|
usage: Output in JSON format
|
|
- name: publish
|
|
shorthand: p
|
|
default_value: '[]'
|
|
usage: |
|
|
Publish a port (can be repeated): [[HOST_IP:]HOST_PORT:]SANDBOX_PORT[/PROTOCOL] (local) or SANDBOX_PORT[/tcp] (cloud)
|
|
- name: unpublish
|
|
default_value: '[]'
|
|
usage: |
|
|
Unpublish a port (can be repeated): [HOST_IP:]HOST_PORT:SANDBOX_PORT[/PROTOCOL] (local) or SANDBOX_PORT[/tcp] (cloud)
|
|
inherited_options:
|
|
- name: cloud
|
|
default_value: "false"
|
|
usage: |
|
|
Dispatch to Docker Cloud Sandboxes API instead of local sandboxd (supported by a growing set of verbs — run 'sbx --cloud --help' for the current list)
|
|
- name: debug
|
|
shorthand: D
|
|
default_value: "false"
|
|
usage: Enable debug logging
|
|
- name: no-input
|
|
default_value: "false"
|
|
usage: |
|
|
Never prompt; commands that need an answer fail with the command to run instead
|
|
example: |4-
|
|
# List published ports
|
|
sbx ports my-sandbox
|
|
|
|
# Publish sandbox port 8080 to an ephemeral host port
|
|
sbx ports my-sandbox --publish 8080
|
|
|
|
# Publish with a specific host port
|
|
sbx ports my-sandbox --publish 3000:8080
|
|
|
|
# Unpublish a port
|
|
sbx ports my-sandbox --unpublish 3000:8080
|
|
|
|
# Expose port 8080 on a cloud sandbox
|
|
sbx --cloud ports sbx_abc123 --publish 8080
|
|
|
|
# Remove an exposed port from a cloud sandbox
|
|
sbx --cloud ports sbx_abc123 --unpublish 8080
|
|
see_also:
|
|
- sbx - Manage AI coding agent sandboxes.
|