container
Configuration of a container resource backed by a registry image.
Corresponds to the container: key in a resource entry. The runtime
pulls image, applies the declared port mappings, mounts volumes,
and injects environment variables before starting the container.
See [crate::DockerfileConfig] for the locally-built equivalent.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
command | Command | no | Optional override for the image default CMD. The image ENTRYPOINT is preserved. See [Command] for the two accepted forms (string or argument list) and for what this means against an image whose entrypoint is a binary rather than a shell. | |
depends_on | array of string | no | Names of other resources this container must wait for before starting. Validated by [crate::Manifest::validate]. | |
entrypoint | Command | no | Optional override for the image ENTRYPOINT, the executable the container runs. See [Command] for the accepted forms. Setting this discards the image CMD: every target (the Engine API, Compose and Kubernetes) ignores the image default command once an entrypoint is overridden. Set command as well to supply arguments. An empty list or a blank string is rejected; omit the field to keep the image entrypoint. | |
env | map of string | no | Environment variables injected into the container at startup. Values are interpolated: ${env.NAME} and ${resources.name.property} expressions are resolved at runtime. | |
healthcheck | Healthcheck | no | Optional healthcheck. Overrides whatever is baked into the image. See [Healthcheck] for field semantics and defaults. | |
image | string | yes | Full image reference including the tag, e.g. "nginx:1.25-alpine". | |
ports | array of PortMapping | no | Port mappings between the host and the container. Each element is a [PortMapping]: either a bare container port (mirrored on the host) or a full "host:container" string. | |
secrets | map of string | no | Sensitive environment variables injected at runtime. These values behave like env during local execution, but production exporters replace them with placeholders instead of writing their contents to Compose, Kubernetes or Helm artifacts. | |
volumes | array of string | no | Volume mappings in "host:container" or "named:container" form. Relative host paths (starting with .) are resolved against the manifest directory by [crate::Manifest::resolve_host_volume_paths] before they reach the runtime. | |
working_dir | string | no | Optional working directory override inside the container. |