Applications / User guide
Containers
Run container workloads with explicit placement, ports, secrets, and persistent storage.
On this page
Before you begin
Use an eligible instance and supported container runtime. Prepare a reachable image and any private registry credentials, environment configuration, and storage.
Get started
- Choose an image, target placement, and the resources required by the workload.
- Configure exposed ports, secret references, and volume bindings.
- Create the container and inspect its actual runtime status.
- Verify application reachability using the configured private endpoint or exposure path.
Operate the service
Use container logs and supported exec access for diagnosis. Inspect resource consumption and restart behavior. Separate writable container layers from durable volume data and verify storage retention before deleting a workload.
Availability and limits
Container features vary by runtime. Inventory discovery does not imply that an existing container has the same lifecycle controls as a platform-created one. Public reachability needs an explicit networking configuration.
On a host enrolled in a Tailscale tailnet, a container's tailnet ports are published as a Tailscale Service tagged tag:anchras-ct, hosted by the host's Anchras agent. On a Tailscale tailnet, the tailnet policy must define that tag in tagOwners, and the host must be approved: add "autoApprovers": {"services": {"tag:anchras-ct": ["tag:agent"]}}, or approve the host on the Services page of the Tailscale admin console. Until then the container keeps running without an endpoint and names the host it is waiting for. On an Anchras Network tailnet, no policy edit is needed: Anchras declares tag:anchras-ct itself and approves the host's agent.
A service with automatic placement can be placed on another node after five minutes without an agent heartbeat. Losing contact with Anchras does not stop the original container: both copies can run until the original node reconnects and cleanup completes. Use automatic placement only when the application tolerates concurrent copies, including any writes to external databases or queues. Choose an explicit host target when the workload must wait for that machine instead. A service pinned by a volume on its node waits for that node; an interrupted task is not automatically re-run on another node.
Troubleshooting
For an image-pull failure, check registry credentials and network access. For repeated exits, inspect the entrypoint, environment, and logs. For missing data, check that the intended volume was mounted at the correct path.
Next steps
Use the CLI guide to automate repeatable work, or the API guide to integrate Anchras with your own tools.
CLI commands
Install and authenticate using the CLI guide. The table describes command families; required arguments are shown in their usage output.
| Command | Purpose |
|---|---|
container list | List the org's containers, newest first (ContainerService). --status failed,error keeps the containers in any of those statuses (the console's "Needs attention" set); --page, --page-size. get, create, delete, logs and exec act on one container. create --placement auto (the default) fits the container onto a ready host of the project by --cpu-millis, --memory-mb, --gpus (NVIDIA, passed through by docker or podman) and --on tag:NAME / --on LABEL=VALUE (repeatable; a tag is one of the host's tailnet device tags, ADR-079 §7; a name in the host's tags instance label no longer matches: it was retired after Beta 0.38, the one release it still counted, and instances move-label-tags --clear-label moves it to the device), and uses a cluster only when the workload needs one (a public port without an ingress edge, file shares or block volumes; a cluster port runs on a host, on loopback, for the container's app network) or no host fits; a GPU or --on never falls back to a cluster. --replicas N places N copies on hosts under one name, one placement per replica (--spread prefer, the default, lets a node already running one take another when no other fits; --spread strict refuses it); get lists each replica's node, status, readiness and reason (ADR-081 slice 2); logs and exec act on replica 0 unless --replica N names another (ADA-2385). A node whose runtime is pct takes no replica of a workload with more than one: a pct replica is not reachable under the workload's name, so placement uses Docker or Podman nodes and says why when the pool has none. list adds a READY column ("2/3") when a host workload is listed (JSON ready_replicas; ADA-2386). get prints where it landed and why (placement: and why:; JSON placement_decision). Once the tailnet policy names anchras.com/cap/run (ADR-079), placement also checks it for the container's creator on every candidate host: a host the policy refuses is skipped, why: names the grant that allowed the chosen host and the policy's explanation for the refused ones, and a create the policy allows nowhere is refused with the explanation. A container a later policy save no longer allows where it runs shows (out of policy) in the status column and a policy: line; it keeps running, and its next placement is refused. A task with --schedule (five-field cron) under auto or host placement runs on a host through the control plane's scheduler, one run per tick, placed anew each time (ADR-081 slice 3); between runs it is scheduled, and get prints schedule:, last_run: and next_run: (JSON last_run, next_run_at). A tick that arrives while the previous run is still running is recorded as skipped. --placement cluster keeps the Kubernetes CronJob. A spec change (an image update) is a new generation; on a host service whose port is reached through a VIP Service the new generation starts as a second container, named anchras-ct-<id>[-r<replica>]-g<generation> on the node, and the name swaps to it once its readiness probe passes, then the old one is removed (ADR-081 slice 4); replicas swap one at a time, lowest index first. A port published on the host, pct and a node volume keep replacing in place, and the operation log says why. get prints generation: once it moved past the first, with (gN serving) while an update is in flight or after one rolled back (then last_error says why; update again to retry), update: with the progress, and each replica's generation in the replicas table (JSON generation, serving_generation, rollout, replica_placements[].generation). |
container update --id <id> [--image <ref>] [--replicas N] [--cpu-millis N] [--memory-mb N] [--schedule CRON] [--env KEY=VALUE]... [--unset-env KEY]... | Change a container in place (ContainerService.UpdateContainer): only the flags you pass change. --env sets or adds a variable and --unset-env removes one; the rest of the environment stays (the API replaces the whole map, so the CLI reads it first). A change to the image, resources or environment starts a new spec generation (get shows generation:) that rolls out where the container runs: a rolling update on a cluster, and on a host a second container started beside the serving one when its port is served by name (ADR-081 slice 4), else a replaced container. --replicas N alone is not a new generation: replicas are added or removed and the serving ones keep running; on hosts each replica is its own placement (ADR-081 slice 2). A task runs once, or on its --schedule: --schedule '0 3 * * *' changes a task's cron schedule in place on hosts (auto or host placement; ADA-2387), not a new generation, and its scheduler entry moves with it; --schedule '' clears it, and the task then waits stopped and runs once on its next container start. A task on an explicit cluster keeps the CronJob schedule it was created with, and a task cannot start or stop being scheduled while a run is placing or running. container list adds a NEXT RUN column when a scheduled task is listed (JSON next_run_at, last_run). A container a catalog deployment or a fleet rollout owns is refused; upgrade the deployment instead. scale --id <id> --replicas N is update --replicas. |
container stop <id> / container start <id> | stop tears the workload down where it runs (the same teardown as delete, waiting for the node) and keeps the record at status stopped, with its host ports released; start places it again at its current generation, on the reconciler's next pass (its previous host is preferred while it still fits). Both are UpdateContainer with desired_state, under container.stop / container.start. --id also works. |
container runs <id> | List a scheduled task's runs, newest first (ContainerService.ListContainerRuns): the tick, status (running, succeeded, failed, skipped), the node it ran on, its exit code, start and finish, and why it failed or was skipped. The last 100 runs are kept per container. --page, --page-size; supports structured output. |
API reference
Browse procedures, request and response types, and download the complete OpenAPI contract.
