Containers on a host

A host runs its own container runtime, and MIOSA manages containers on it: create, start, stop, restart, delete, and stream logs and resource usage. Everything is addressed by the host ID and the container ID, and every operation is tenant-scoped.

MIOSA does not build the image for you. Your image must already be pullable by the host’s runtime.

Run a container

FieldTypeRequiredDescription
namestringYes1 to 63 characters, starting with a letter or digit
imagestringYesImage reference the host’s runtime can pull
commandstring[]NoCommand and arguments; default [] (the image default)
envobjectNoEnvironment variables as a map; default {}
portsobject[]No{host_port, container_port, protocol}; protocol defaults to tcp
volumesobject[]No{source, target, readonly}; readonly defaults to false
restart_policystringNono, on-failure, always, or unless-stopped (default)
runtimestringNoauto (default), docker, or podman

The response is {"container": {...}} with id, name, image, command, env, ports, volumes, restart_policy, runtime, state, runtime_id, runtime_name, exit_code, started_at, stopped_at, last_error, last_cpu_percent, last_mem_mb, and last_stats_at.

Container states are provisioning, running, stopped, failed, removing, and removed.

Logs

Stats

The latest sample is also kept on the container record as last_cpu_percent, last_mem_mb, and last_stats_at.

Lifecycle

miosa host container start <host> <container>
miosa host container stop <host> <container>
miosa host container restart <host> <container>
miosa host container rm <host> <container> --force --yes
ActionRESTNotes
StartPOST /opencomputers/hosts/{host_id}/containers/{id}/startOnly from stopped or failed; returns 409 otherwise
StopPOST .../containers/{id}/stopOnly from running; accepts a timeout_s grace period, default 10
RestartPOST .../containers/{id}/restartAllowed from running, stopped, or failed
UpdatePATCH .../containers/{id}image, command, env, ports, volumes, restart_policy, runtime
DeleteDELETE .../containers/{id}?force=trueforce deletes a running container; returns 202

Deleting a container does not delete its volumes for you unless you asked for the volume to be removed with the container.

Compose projects

A compose project is a docker-compose file the host keeps running.

miosa host compose list <host>
miosa host compose up <host> app --build --pull
miosa host compose down <host> app --remove-volumes
miosa host compose rm <host> app --yes
ActionREST
ListGET /opencomputers/hosts/{host_id}/compose-projects
CreatePOST .../compose-projects with name, yaml (required), env, pull, build
UpPOST .../compose-projects/{id}/up
DownPOST .../compose-projects/{id}/down with remove_volumes
DeleteDELETE .../compose-projects/{id}
EventsGET .../compose-projects/{id}/events (SSE)

Compose project states are creating, running, partial, stopped, failed, and removing. The events stream carries {type, payload} frames where type is progress, log, or error.

--remove-volumes destroys the project’s volumes. Confirm what you intend to lose before using it on a stateful project.

Plan limits

The number of container slots a tenant can use depends on the plan, and a compose project counts its services against the same budget.

PlanContainers and compose service slots
free2
starter10
pro50
team250
enterprise1000

Exceeding the limit returns 402 with error: "plan_limit_reached", plus the limit and current values. See Billing and limits for the other plan-scoped limits.

Was this page helpful?