From 522420ef341a6105325fa25f41463d21ce33bcc8 Mon Sep 17 00:00:00 2001 From: Bret Fisher Date: Wed, 2 May 2018 23:18:19 -0400 Subject: [PATCH] Updating some compose info for devs --- slides/intro/Compose_For_Dev_Stacks.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/slides/intro/Compose_For_Dev_Stacks.md b/slides/intro/Compose_For_Dev_Stacks.md index 3a4f22be..917eb91f 100644 --- a/slides/intro/Compose_For_Dev_Stacks.md +++ b/slides/intro/Compose_For_Dev_Stacks.md @@ -60,6 +60,10 @@ Before diving in, let's see a small example of Compose in action. If you are using the official training virtual machines, Compose has been pre-installed. +If you are using Docker for Mac/Windows or the Toolbox, docker-compose comes with them. + +If you're on Linux desktop/server, you'll need to get the lastest at https://github.com/docker/compose/releases + You can always check that it is installed by running: ```bash @@ -137,21 +141,23 @@ services: ## Compose file versions -Version 1 directly has the various containers (`www`, `redis`...) at the top level of the file. +Version 1 (or no version) is legacy and shouldn't be used. Version 2 has multiple sections: -* `version` is mandatory and should be `"2"`. +* `version` is mandatory and should be `"2"` or later. -* `services` is mandatory and corresponds to the content of the version 1 format. +* `services` is mandatory. A service is one or more replicas of the same image running as containers. * `networks` is optional and indicates to which networks containers should be connected. -
(By default, containers will be connected on a private, per-app network.) +
(By default, containers will be connected on a private, per-compose-file network.) * `volumes` is optional and can define volumes to be used and/or shared by the containers. Version 3 adds support for deployment options (scaling, rolling updates, etc.) +Docker Docs has good info on versions https://docs.docker.com/compose/compose-file/ + --- ## Containers in `docker-compose.yml` @@ -260,6 +266,8 @@ Removing trainingwheels_www_1 ... done Removing trainingwheels_redis_1 ... done ``` +Use `docker-compose down -v` to remove everything including volumes. + --- ## Special handling of volumes