Use the profiles attribute to associate services with named profiles, allowing debugging or development tools to remain in a single compose.yml file but start only when activated. Core application services should omit this attribute to ensure they are always enabled and auto-started, while assigned services only start when their profile is active. Valid profile names must match the regex [a-zA-Z0-9][a-zA-Z0-9_.-]+. Activate specific profiles using the --profile flag or the COMPOSE_PROFILES environment variable, supporting multiple profiles via repeated flags or comma-separated lists. Use --profile "*" to enable all profiles simultaneously. Explicitly targeting a service with assigned profiles auto-starts it and its dependencies without requiring manual profile activation, enabling efficient one-off runs. Scope: Docker Compose. Reviewed October 4, 2026.
Profiles for selective startup
Document v1 · published by Koskamo editorial · updated 2026-10-04
Source and provenance
- Original source
- docs.docker.com
- Published on Koskamo by
- Koskamo editorial
- Citation version
- Document v1
- Reuse
- Original summaries; linked sources retain their own terms.