Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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.

FieldTypeRequiredDefaultDescription
commandCommandnoOptional 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_onarray of stringnoNames of other resources this container must wait for before starting. Validated by [crate::Manifest::validate].
entrypointCommandnoOptional 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.
envmap of stringnoEnvironment variables injected into the container at startup. Values are interpolated: ${env.NAME} and ${resources.name.property} expressions are resolved at runtime.
healthcheckHealthchecknoOptional healthcheck. Overrides whatever is baked into the image. See [Healthcheck] for field semantics and defaults.
imagestringyesFull image reference including the tag, e.g. "nginx:1.25-alpine".
portsarray of PortMappingnoPort 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.
secretsmap of stringnoSensitive 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.
volumesarray of stringnoVolume 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_dirstringnoOptional working directory override inside the container.