Files
floci-cli/docs/help/floci-aws-start.txt
T
soreavis 7bc0562e38 feat(start): add --bind to publish the port on one host address (#90)
* feat(start): add --bind to publish the port on one host address

start published the API port with no host address, so it went on every
interface unless the runtime's default was changed, and the CLI had no
option to choose the address.

--bind ADDR publishes it on that address; on AWS it also sets
FLOCI_SERVICES_UI_BIND_ADDRESS so the web console follows. It is also a
profile key and a config profile create flag. The address is parsed as
one IP literal and passed on in one form, IPv4 dotted and IPv6 in full,
so docker and podman only see a form they read. A value that is not an
IP literal, an IPv6 zone or IPv4 not written dotted is refused with exit
2, before restart stops anything. The CLI still connects to 127.0.0.1,
so any address but 127.0.0.1 or 0.0.0.0 also needs --endpoint.

start records the address in a floci_bind label, and restart keeps it,
from the profile or else from that label. A container without the label
restarts without --bind: the addresses a runtime reports also hold its
own defaults (Podman's 0.0.0.0, default_host_ips), so they are not read
back.

Signed-off-by: soreavis <263610811+soreavis@users.noreply.github.com>

* fix(start): probe the --bind address in the port check

The port check before start bound the wildcard address. Linux refuses
that while another socket holds the port on 127.0.0.1, so start --bind
with a LAN address exited 1 on that port although the address was free.

With --bind the check now binds that address. When that works, the
port is free only if nothing answers there, since macOS and Windows let
the bind share the port with a listener on the wildcard. When it fails,
a bind on port 0 tells whether this machine has the address at all (the
error text cannot: Linux translates it). If it does not, docker judges
the address. If it does, the old rule decides, and below 1024 it asks
whether something answers on that address instead of on loopback.
Without --bind, or with --bind 0.0.0.0 or ::, the check is unchanged.

Signed-off-by: soreavis <263610811+soreavis@users.noreply.github.com>

---------

Signed-off-by: soreavis <263610811+soreavis@users.noreply.github.com>
2026-11-27 17:01:30 -06:00

33 lines
2.3 KiB
Plaintext

Usage: floci aws start [-hqvV] [--detach] [--json] [--no-color] [--no-emoji] [--bind=<address>]
[--container=<name>] [--endpoint=<url>] [--image=<ref>] [--namespace=<name>]
[-o=text|json|yaml] [--persist=<dir>] [--port=<port>] [--profile=<name>]
[--pull=always|missing|never] [--services=<csv>] [--security-opt=<opt>]...
Start the Floci AWS emulator container
--bind=<address> Host address to publish the API port on, such as 127.0.0.1, and on AWS
the web console too (default: every interface). An address other
than 127.0.0.1 or 0.0.0.0 also needs --endpoint
--container=<name> Floci container name (default: floci)
--detach Return immediately without waiting for readiness
--endpoint=<url> Floci server endpoint URL (default: http://localhost:4566)
-h, --help Show this help message and exit.
--image=<ref> Image reference to use (default: floci/floci:latest)
--json Shorthand for --output json
--namespace=<name> Docker resource namespace for the containers this instance launches
(default: derived from --container; none for the default container)
--no-color Disable ANSI colors
--no-emoji Plain ASCII marks instead of Unicode ones (the default when output is
piped)
-o, --output=text|json|yaml
Output format: text, json, yaml
--persist=<dir> Host directory for persistent state
--port=<port> Host port to bind (default: 4566)
--profile=<name> Config profile from ~/.floci/profiles/
--pull=always|missing|never
Image pull policy: always, missing, never
-q, --quiet Suppress non-error output
--security-opt=<opt> Docker security option for the emulator container, repeatable
(label=disable lets it reach the Docker socket on SELinux hosts)
--services=<csv> Comma-separated list of services to enable
-v, --verbose Debug logging to stderr
-V, --version Print version information and exit.