Docker Compose version 3.8 or 3.9 for latest?

Seems like you found another inconsistency :slight_smile:
Maybe extends still work with docker-compose, but don’t with stack deployments (=swarm services)

That what’s left of my swarm deployments leverages make and simple envsubst substition to render the docker-compose.yml files before passing them to docker stack deploy -c - (=read compose file from STDIN). The same can be done with docker-compose using docker-compose -f -. I found it to provide more flexibility then working with any of the build in mechanisms.

Instead of envsubst, one could use gomplate and go wild with the template and add conditional blocks (expose ports for specific purpose? use database x instead of y, add n replicas instead of a single container, add service z to the mix… whatever commes to mind). Though what feels natural for Kubernetes deployments with helm charts (which pretty much bring this kind of templating to the table + versioning + simple way to override parameters from the cli) feels cumbersome for compose/swarm deployments.

1 Like