Stacks and Compose compatibility
Worked example
This is an offline lesson. Data are fictional and Docker commands are unexecuted. Any optional execution requires an authorized disposable VM, a verified context, synthetic data, restricted access and no external transmission. Do not collect secrets or private output. Use only the fictional worksheet for this exercise. Before a separately authorized read-only server query, verify the effective endpoint including environment overrides, project or cluster identity, and access scope. Never deploy the fragments, use real credentials or transmit private inspection output.
Illustrative legacy v3 stack fragment (not runnable):version: "3.8"services: web: image: registry.example.test/bm/web:REVIEW_REQUIRED deploy: replicas: 3 update_config: parallelism: 1 placement: constraints: [node.role == worker]# No actual registry or approved digest supplied.Staged read-only review: docker stack config -c stack.yamlDocker documents stack deploy as accepting the older Compose v3 format rather than the latest Compose specification. Build application images separately, make approved image content available to every eligible node, and use immutable references in an authorized deployment. The placeholder in this fragment is not a usable release. Do not expect Compose development watch, build behavior or environment-sourced secrets to work in stack deployment. Verify supported fields against the installed Engine and inspect stack config privately; rendering a model does not prove that the manager can schedule tasks or that images and secrets exist. Stack deployment is a manager operation and may create or update services. Stack changes are not a transactional rollback for all services or data. The stack.yaml name is a hypothetical file, not a supplied runnable stack. Rendering with stack config is a local model check, not a deployment gate by itself. Review unsupported keys, effective interpolation and digest/platform evidence before any separately approved manager operation.
Common mistake
Do not copy a modern development Compose file directly into stack deploy and assume that unsupported attributes are enforced.
Manual practice
Review a fictional Compose file containing build, develop.watch and environment-sourced secrets. Explain which inputs need separate redesign and list preflight evidence for an immutable stack release.
Worksheet: lab-fixtures/docker-swarm-orchestration/06-stacks/scenario.txt.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Stacks and Compose compatibility — Knowledge check
Interpret cluster orchestration evidence and make a safe operational decision.
Which file family does Docker document for stack deploy?
Where should images be built for a reviewed stack release?
Does stack config establish runtime readiness?