First version of stack deployment tutorial#685
First version of stack deployment tutorial#685mdlinville merged 1 commit intodocker:vnext-enginefrom
Conversation
dnephin
left a comment
There was a problem hiding this comment.
Looks great, few comments about the commands and typo
engine/swarm/stack-deploy.md
Outdated
| --- | ||
|
|
||
| When running Docker Engine in swarm mode, you can use `docker stack deploy` | ||
| (or just `docker deploy`) to deploy a complete application stack to the swarm. |
There was a problem hiding this comment.
We're planning on keeping docker deploy experimental in 1.13 so that we can change it later if we need to. We might want to avoid calling it out here since it won't be available to everyone like docker stack deploy.
engine/swarm/stack-deploy.md
Outdated
| The `deploy` command accepts a stack description in the form of a [Compose | ||
| file](/compose/compose-file.md). | ||
|
|
||
| The `docker deploy` command supports any Compose file of version "3.0" or |
engine/swarm/stack-deploy.md
Outdated
| Compose doesn't take advantage of swarm mode, and deploys everything to a | ||
| single node. You can safely ignore this. | ||
|
|
||
| <!-- TODO: this warning needs to be updated for `docker deploy` --> |
There was a problem hiding this comment.
I think this is done: docker/compose#4170 (needs merged)
Unless you mean something else
engine/swarm/stack-deploy.md
Outdated
|
|
||
| 1. Create the stack with `docker deploy`: | ||
|
|
||
| $ docker deploy --compose-file docker-compose.yml stackdemo |
engine/swarm/stack-deploy.md
Outdated
| The last argument is a name for the stack. Each network, volume and service | ||
| name is prefixed with the stack name. | ||
|
|
||
| 2. Check that it's running with `docker service ls`: |
There was a problem hiding this comment.
docker stack services stackdemo might be more appropriate here?
engine/swarm/stack-deploy.md
Outdated
| Removing service stackdemo_redis | ||
| Removing network stackdemo_default | ||
|
|
||
| 4. Bring the registry down ith `docker service rm`: |
0ca615c to
5010fdb
Compare
|
@dnephin Thanks! Addressed. |
5010fdb to
a6ff281
Compare
|
Oops, please rebase your work on |
engine/swarm/stack-deploy.md
Outdated
| a stack description in the form of a [Compose file](/compose/compose-file.md). | ||
|
|
||
| The `docker stack deploy` command supports any Compose file of version "3.0" or | ||
| above. If you have an older version, upgrading is simple - see the |
There was a problem hiding this comment.
Let's not editorialize about how simple it is. :) Something like "If you have an older version, see ."
engine/swarm/stack-deploy.md
Outdated
| Because a swarm consists of multiple Docker Engines, a registry is required to | ||
| distribute images to all of them. You can use the | ||
| [Docker Hub](https://hub.docker.com), or maintain your own, but for the purposes | ||
| of this tutorial it's sufficient to create a throwaway registry. |
There was a problem hiding this comment.
change "it's sufficient to create a throwaway registry" to something like "This tutorials creates a simple registry, which you can discard afterward."
|
|
||
| $ docker service create --name registry --publish 5000:5000 registry:2 | ||
|
|
||
| 2. Check its status with `docker service ls`: |
| of this tutorial it's sufficient to create a throwaway registry. | ||
|
|
||
| 1. Start the registry as a service on your swarm: | ||
|
|
There was a problem hiding this comment.
Please use fenced code blocks instead of relying on indentation.
engine/swarm/stack-deploy.md
Outdated
| 2. Check its status with `docker service ls`: | ||
|
|
||
| $ docker service ls | ||
| ID NAME REPLICAS IMAGE COMMAND |
There was a problem hiding this comment.
As above, fenced code blocks. Please separate the command input from the output with a carriage return.
engine/swarm/stack-deploy.md
Outdated
|
|
||
| 2. Create a file called `app.py` in the project directory and paste this in: | ||
|
|
||
| from flask import Flask |
There was a problem hiding this comment.
When you change this to a fenced version, use Dockerfile as the highlighter.
```Dockerfile
From flask import Flask
engine/swarm/stack-deploy.md
Outdated
| RUN pip install -r requirements.txt | ||
| CMD ["python", "app.py"] | ||
|
|
||
| 5. Finally, create a file called `docker-compose.yml` and paste this in: |
engine/swarm/stack-deploy.md
Outdated
|
|
||
| 5. Finally, create a file called `docker-compose.yml` and paste this in: | ||
|
|
||
| version: '3' |
There was a problem hiding this comment.
Use fences for this code block and designate it as yaml in the highlighter.
engine/swarm/stack-deploy.md
Outdated
| Creating stackdemo_redis_1 | ||
| Creating stackdemo_web_1 | ||
|
|
||
| 2. Check that it's running with `docker-compose ps`: |
a6ff281 to
c5fa76e
Compare
|
Rebased on |
|
By the way, this tutorial also depends on Compose version 1.10, which isn't out yet. I don't know if that affects what branch it should be rebased on. |
|
yeah, sorry that you can't see the Netlify build failure logs. Netlify is working to make this feature available. I'll have a look and let you know what's going on. We should probably add a milestone for Compose 1.10 and tag this into that milestone as well. As far as the branches, there is a cc/ @londoncalling can you please create the milestone and tag this into it? |
|
Also the Netlify check doesn't apply to |
mdlinville
left a comment
There was a problem hiding this comment.
Looking great! Just a few style-related tweaks for highlighting, and then this is ready. Thanks!
engine/swarm/stack-deploy.md
Outdated
|
|
||
| 1. Start the registry as a service on your swarm: | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Please add the bash highlighter after the fence. like this:
```bashAlso add it to the other codeblocks that are terminal commands. There are lots of other highlighters such as markdown, dockerfile, json, yaml, go, etc.
engine/swarm/stack-deploy.md
Outdated
|
|
||
| 3. Create a file called `requirements.txt` and paste these two lines in: | ||
|
|
||
| ``` |
There was a problem hiding this comment.
For this one you can use the none highlighter.
Signed-off-by: Aanand Prasad <[email protected]>
c5fa76e to
da3b4ff
Compare
|
Tagged all the code blocks with the appropriate highlighter, per @mstanleyjones' advice |
Based on @vdemeester's work in #672
To try this tutorial out, you need a 1.13 daemon, a 1.13 client and a master build of Compose.