13.2.2 Delivery Targets
A focused guide to Delivery Targets, connecting core concepts with practical Docker and container operations.
Delivery targets are the different kinds of destinations a containerized application's CI/CD pipeline might actually deploy to — a single server, a Compose-based host, a Swarm cluster, a Kubernetes cluster — each requiring a somewhat different deployment mechanism even though they share the same underlying, already-built image.
Why the Same Image Can Deploy to Many Different Target Types
Since the image itself is built once and remains the same regardless of where it's deployed, the deployment mechanism — not the image — is what actually varies between different delivery target types.
docker run -d registry.example.com/myapp:1.0
docker compose up -d
docker stack deploy -c docker-stack.yml mystack
Each of these represents a different deployment mechanism, all potentially deploying that exact same underlying image.
Choosing a Delivery Target Appropriate to the Application's Scale
A small, single-instance application might reasonably deploy to a single server directly, while an application needing redundancy or horizontal scaling typically needs a target supporting multiple replicas and load balancing, like Swarm or Kubernetes.
ssh server "docker pull myapp:1.0 && docker run -d myapp:1.0"
docker stack deploy -c docker-stack.yml mystack
Why Pipeline Deployment Logic Should Reflect the Specific Target
The final deployment step in a CI/CD pipeline needs to use whichever mechanism actually matches the chosen delivery target, rather than assuming one universal deployment approach works for every scenario.
deploy:
steps:
- run: ssh prod-server "docker compose pull && docker compose up -d"
Why Delivery Targets Matter
Understanding the range of possible delivery targets, and choosing the one appropriate to an application's actual scale and redundancy needs, is an important decision shaping exactly how a pipeline's final deployment step needs to be implemented.