3 ms·
Docker-compose v2.4 is arguably much better than v3.0, and in a lot of ways they are really separate specs, not a "newer version" of an old spec. Compose v3 exi
by nikisweeting 6y ago
Docker-compose v2.4 is arguably much better than v3.0, and in a lot of ways they are really separate specs, not a "newer version" of an old spec. Compose v3 exists to push you towards swarm, whereas compose v2 exists to make docker-compose a complete mini cluster management tool, and succeeds at it in my experience.
We continue to use v2.4 in all our projects today because it allows you do easily do things like define startup order with healthchecks, as well as limit cpu, memory, etc. without having to spin up a whole swarm cluster.
- ucarion 6y agoI push for docker-compose v2 over v3 at work for the same reason. Just to spell out explicitly what nikisweeting is hinting at: For local development use-cases, docker-compose v3 is just v2 minus all the features Docker Swarm doesn't support.
- nikisweeting 6y agoIf anyone is curious, this is the native official way to define startup order using healthchecks present in v2.4 (but removed in v3 to push you towards swarm): some_service: depends_on: other_service: condition: service_healthy
- nikisweeting 6y agoTIL this has been returned to compose in the latest version! They merged the specs in September so this is now officially supported again going forward. That fixes my last major gripe with compose trying to push people to swarm, which no longer seems to be the case after this merge. https://github.com/docker/compose/releases/tag/1.27.0 https://github.com/docker/compose/releases/tag/1.27.0