Update Compose_For_Dev_Stacks.md

This commit is contained in:
Jérôme Petazzoni
2018-05-05 05:39:25 -05:00
committed by GitHub
parent 522420ef34
commit d6e19fe350

View File

@@ -60,9 +60,9 @@ 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 are using Docker for Mac/Windows or the Docker Toolbox, 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
If you are on Linux (desktop or server environment), you will need to install Compose from its [release page](https://github.com/docker/compose/releases) or with `pip install docker-compose`.
You can always check that it is installed by running:
@@ -139,13 +139,11 @@ services:
---
## Compose file versions
## Compose file structure
Version 1 (or no version) is legacy and shouldn't be used.
A Compose file has multiple sections:
Version 2 has multiple sections:
* `version` is mandatory and should be `"2"` or later.
* `version` is mandatory. (We should use `"2"` or later; version 1 is deprecated.)
* `services` is mandatory. A service is one or more replicas of the same image running as containers.
@@ -154,9 +152,20 @@ Version 2 has multiple sections:
* `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/
## Compose file versions
* Version 1 is legacy and shouldn't be used.
(If you see a Compose file without `version` and `services`, it's a legacy v1 file.)
* Version 2 added support for networks and volumes.
* Version 3 added support for deployment options (scaling, rolling updates, etc).
The [Docker documentation](https://docs.docker.com/compose/compose-file/)
has excellent information about the Compose file format if you need to know more about versions.
---