3 ms·
Since no one has actually provided links to more info about Compose V3, I'm happy to step in and help. > But there's no links to further documentation or anyth
by zenlikethat 10y ago
Since no one has actually provided links to more info about Compose V3, I'm happy to step in and help.
> But there's no links to further documentation or anything. Can this be used to deploy easily to a cluster of Droplets for instance?
Yes! This is exactly what the Compose V3 format (now native to Docker CLI, as noted in the article) is intended for. It creates/manages native Docker swarm services (and networks, etc.).
The Docker official docs might take a minute to catch up in terms of Google indexing, etc., but you can always get the latest on GitHub to get a feel for what has changed from previous versions and/or how to learn Compose V3.
https://github.com/docker/docker.github.io/blob/master/compose/compose-file.md https://github.com/docker/docker.github.io/blob/master/compo... is a Markdown document outlining various Compose options. The main thing to keep in mind is that 'build' will not work as it has traditionally (use 'image' instead), and you gain additional access to a 'deploy' key to specify, e.g., number of "replicas" (indentical copies for scale) of a given container.
https://github.com/nathanleclaire/composeexample/blob/master/docker-compose.yml https://github.com/nathanleclaire/composeexample/blob/master... is a V3 version of the canonical Compose Redis + Python "page counter" app that may help to get the feel for things.
In general:
- 'docker deploy' will create or update a 'docker stack' (group of services) ('docker deploy' is shorthand/porcelain for 'docker stack deploy')
- 'docker stack' will allow you to manage these stacks (list, remove, etc.), created from Compose files
- 'docker service' will allow you to manage the individual services created (a service is a group of homogenous containers -- think 3 copies of a webapp intended to sit behind a load balancer)
Check out the '--help' text for each.