In Compose docs:
In top-level docs, under "Create and manage an application"
healthcheck option)Essentially what's new is the deploy: key in Compose, which is now where resource constraints and deploy/swarm stuff lives for each service.
One wrinkle: You can't have a deploy: key on a service whose image is being built in that compose file; you can only deploy pre-built images, so you'd need to use docker-compose build with a YAML file or docker build with a long command line first, then deploy the resulting image.
Because this is all done with docker stack * (the Engine CLI) we should avoid referring to the docker-compose binary in these docs; it's not really necessary.
Machine command for creating a node w/v1.13:
docker-machine create -d virtualbox --virtualbox-memory 5000 --virtualbox-disk-size 8000 --virtualbox-boot2docker-url "https://github.com/boot2docker/boot2docker/releases/download/v1.13.0-rc4/boot2docker.iso" my-machine
Better yet, use this zero-to-swarm-in-10-seconds script from @thaJeztah:
https://gist.github.com/thaJeztah/90d92e2114287144990b503efd952a3a
Example voting app: posts data to a redis queue, worker app pulls data out of redis and puts it into postgresql.
https://gist.github.com/ManoMarks/39748aa1931f592303bd111c3d3dfed4#file-docker-compose-yml
Docs for V2-based voting app:
https://github.com/docker/labs/blob/master/beginner/chapters/votingapp.md
Docker stack refdocs:
https://docker-docs-vnext-engine.netlify.com/engine/reference/commandline/stack/ (autogen)
To run app on a swarm, use that V3 file with this command:
docker stack deploy --compose-file (file) (stackname)
docker stack remove (stackname) takes down an application.
To update an app, docker stack deploy w/same stack name, which re-reads YAML and updates service. That's it! Live stacks are hot-swappable, if you just reuse the stack name. For example, you can kill a single service and bring it back:
docker service rm stack_service #take down a portion of an app.
docker service ls #shows service is stopped
docker stack deploy --compose-file etc #update
docker service ls #shows service is back
@docker/core-compose-maintainers Anything else we should cover? @shin-?
In addition to deploy, aren't these also new in Compose file format v.3?
healthcheckUnsupported or removed from v3
volume_driver not supported in v3, use top-level volumes optionvolumes_fromremoved from v3, use top-level volumes option to share a volume between servicescpu_shares, cpu_quota, cpuset, mem_limit, memswap_limit), use deploy.resources insteadAlso stop_grace_period was added
^ All great things to add to the "What's new in V3 / upgrade" topics!
Except for healthcheck, which should get a separate topic, to be honest; load balancing breaks without it. Adding it to the topic list.
To walkthrough the sample:
docker swarm initsh create-a-swarm.sh (from @thaJeztah)docker stack deploy --compose-file FILE.yaml STACKNAME (where FILE.yaml is Manos' V3 example, and STACKNAME is an arbitrary string)First draft of lab change (still need to change the title and some navigation)
https://github.com/ManoMarks/labs/blob/master/beginner/chapters/votingapp.md
@johndmulhausen @ManoMarks @thaJeztah I'm closing this issue, as I believe it's been addressed by these new and revised topics:
Feel free to re-open if you think we missed anything in John's original list of what needs to be covered
Most helpful comment
@johndmulhausen @ManoMarks @thaJeztah I'm closing this issue, as I believe it's been addressed by these new and revised topics:
Feel free to re-open if you think we missed anything in John's original list of what needs to be covered