Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f5a3c6a

Browse files
author
LRubin
authored
Merge pull request docker#851 from sanscontext/refix-verify
fixing some additional formatting blips
2 parents 3d08faa + b817088 commit f5a3c6a

9 files changed

+77
-45
lines changed

docker-cloud/getting-started/deploy-app/10_provision_a_data_backend_for_your_service.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ redirect_from:
77
title: Provision a data backend for your service
88
---
99

10-
Docker Cloud offers a large number of data stores in the *Jumpstart* library, including Redis, MongoDB, PostgreSQL, and MySQL.
10+
Docker Cloud offers a large number of data stores in the *Jumpstart* library,
11+
including Redis, MongoDB, PostgreSQL, and MySQL.
1112

1213
You may have noticed that your app has a visit counter that's been disabled up
1314
until now. In this step you'll add a data backend that your service will use. In
@@ -18,7 +19,7 @@ The first step is to provision the data service itself. Run this command to
1819
create and run the Redis service using the <a href="https://github.com/docker-library/redis/" target ="_blank">redis</a>
1920
image:
2021

21-
```
22+
```none
2223
$ docker-cloud service run \
2324
--env REDIS_PASS="password" \
2425
--name redis \
@@ -28,7 +29,7 @@ redis
2829

2930
Use `docker-cloud service ps` to check if your new redis service is *running*. This might take a minute or two.
3031

31-
```
32+
```none
3233
$ docker-cloud service ps
3334
NAME UUID STATUS IMAGE DEPLOYED
3435
redis 89806f93 ▶ Running redis:latest 29 minutes ago
@@ -50,7 +51,7 @@ Next, visit or `curl` the load balanced web endpoint again. You'll notice that t
5051

5152
If you're using curl, you should see the counter incrementing like this:
5253

53-
```
54+
```none
5455
$ curl lb-1.$DOCKER_ID_USER.cont.dockerapp.io
5556
Hello World</br>Hostname: web-1</br>Counter: 1%
5657
$ curl lb-1.$DOCKER_ID_USER.cont.dockerapp.io
@@ -63,4 +64,4 @@ $ curl lb-1.$DOCKER_ID_USER.cont.dockerapp.io
6364
Hello World</br>Hostname: web-3</br>Counter: 5%
6465
```
6566

66-
Next, we'll look at [Stackfiles for your service](11_service_stacks.md)
67+
Next, we'll look at [Stackfiles for your service](11_service_stacks.md)

docker-cloud/getting-started/deploy-app/12_data_management_with_volumes.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $ docker-cloud service redeploy redis
2828

2929
Check the container status using the `container ps` command, and wait until the new container is running again. In the example below you can see the original container in the "Terminated" state, and the new container that is "Starting".
3030

31-
```
31+
```none
3232
$ docker-cloud container ps --service redis
3333
NAME UUID STATUS IMAGE RUN COMMAND EXIT CODE DEPLOYED PORTS
3434
redis-1 5ddc0d66 ✘ Terminated redis:staging /run.sh 0 15 minutes ago 6379/tcp
@@ -37,7 +37,7 @@ redis-1 3eff67a9 ⚙ Starting redis:staging /run.sh
3737

3838
Once the container is running, get the web endpoint using `container ps`, then try curling or visiting the web endpoint again
3939

40-
```
40+
```none
4141
$ curl lb-1.$DOCKER_ID_USER.cont.dockerapp.io:80
4242
<h3>Hello Friendly Users!</h3><b>Hostname:</b> web-1<br/><b>Visits:</b> 1%
4343
```
@@ -46,11 +46,14 @@ The Redis cache service redeployment caused the counter to reset.
4646

4747
#### Enabling persistence
4848

49-
The specific Redis image (*redis*) in this tutorial supports data persistence. This is not a common requirement for a Redis cache and it's not enabled by default in most images. However to activate this in *our* image, you only need to set two environment variables.
49+
The specific Redis image (*redis*) in this tutorial supports data persistence.
50+
This is not a common requirement for a Redis cache and it's not enabled by
51+
default in most images. However to activate this in *our* image, you only need
52+
to set two environment variables.
5053

5154
Run the following command to create and set these two environment variables.
5255

53-
```
56+
```none
5457
$ docker-cloud service set \
5558
-e REDIS_APPENDONLY=yes \
5659
-e REDIS_APPENDFSYNC=always \
@@ -63,11 +66,13 @@ open source `redis` image <a href="https://github.com/docker-library/redis/" tar
6366

6467
With these settings, Redis can create and store its data in a volume. The volume is in `/data`.
6568

66-
Visit the web endpoint a few more times to make sure that the cache is working as expected. Then redeploy the Redis service to see if the counter resets, or if it persists even after the container is terminated and re-created.
69+
Visit the web endpoint a few more times to make sure that the cache is working
70+
as expected. Then redeploy the Redis service to see if the counter resets, or if
71+
it persists even after the container is terminated and re-created.
6772

6873
Curl the service to increment the counter:
6974

70-
```
75+
```none
7176
$ curl lb-1.$DOCKER_ID_USER.cont.dockerapp.io:80
7277
<h3>Hello Python users!!</h3><b>Hostname:</b> web-1<br/><b>Visits:</b> 1%
7378
$ curl lb-1.$DOCKER_ID_USER.cont.dockerapp.io:80
@@ -78,13 +83,13 @@ $ curl lb-1.$DOCKER_ID_USER.cont.dockerapp.io:80
7883

7984
Next, redeploy the service using the `service redeploy` command:
8085

81-
```
86+
```none
8287
$ docker-cloud service redeploy redis
8388
```
8489

8590
Check the service status:
8691

87-
```
92+
```none
8893
$ docker-cloud container ps --service redis
8994
NAME UUID STATUS IMAGE RUN COMMAND EXIT CODE DEPLOYED PORTS
9095
cache-1 8193cc1b ✘ Terminated redis:staging /run.sh 0 10 minutes ago 6379/tcp
@@ -93,7 +98,7 @@ cache-1 61f63d97 ▶ Running redis:staging /run.sh
9398

9499
Once the service is running again, curl the web page again to see what the counter value is.
95100

96-
```
101+
```none
97102
$ curl lb-1.$DOCKER_ID_USER.cont.dockerapp.io:80
98103
<h3>Hello Python users!!</h3><b>Hostname:</b> web-3<br/><b>Visits:</b> 4%
99104
```
@@ -134,4 +139,4 @@ set up a volume to save the data.
134139

135140
There's lots more to learn about Docker Cloud, so check out [the rest of our documentation](/docker-cloud/), the [API and CLI Documentation](../../../apidocs/docker-cloud.md), and our [Knowledge Hub](https://success.docker.com/Cloud) and [Docker Cloud Forums](https://forums.docker.com/c/docker-cloud).
136141

137-
Happy Docking!
142+
Happy Docking!

docker-cloud/getting-started/deploy-app/1_introduction.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ redirect_from:
77
title: Introduction to deploying an app in Docker Cloud
88
---
99

10-
In this tutorial you will bring an application to Docker Cloud using either Go or
11-
Python. This tutorial is intended for more advanced beginners who have some
10+
In this tutorial you will bring an application to Docker Cloud using either Go
11+
or Python. This tutorial is intended for more advanced beginners who have some
1212
experience with web applications, and who want to learn more about
1313
multi-container services in Docker Cloud.
1414

@@ -20,4 +20,4 @@ This tutorial assumes that you have:
2020

2121
Let's get started!
2222

23-
[Set up your environment](2_set_up.md).
23+
[Set up your environment](2_set_up.md).

docker-cloud/getting-started/deploy-app/4_push_to_cloud_registry.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,27 @@ In step 2, you set your Docker Cloud username as an environment variable called
1616
First tag the image. Tags in this case denote different builds of an image.
1717

1818
**Python quickstart**
19+
1920
```bash
2021
$ docker tag quickstart-python $DOCKER_ID_USER/quickstart-python
2122
```
2223

2324
**Go quickstart**
25+
2426
```bash
2527
$ docker tag quickstart-go $DOCKER_ID_USER/quickstart-go
2628
```
2729

2830
Next, push the tagged image to the repository.
2931

3032
**Python quickstart**
33+
3134
```
3235
$ docker push $DOCKER_ID_USER/quickstart-python
3336
```
3437

3538
**Go quickstart**
39+
3640
```
3741
$ docker push $DOCKER_ID_USER/quickstart-go
3842
```

docker-cloud/getting-started/deploy-app/5_deploy_the_app_as_a_service.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ title: Deploy the app as a Docker Cloud service
99

1010
In this step you will deploy the app as a Docker Cloud Service. Remember that a service is a group of containers of the same **image:tag**.
1111

12-
What you'll do in this step is slightly different if you have Docker Engine installed locally or not.
13-
If you have Docker Engine installed locally, start at [Deploy app with Docker Engine installed locally](5_deploy_the_app_as_a_service.md#deploy-app-with-docker-engine-installed-locally).
12+
What you'll do in this step is slightly different if you have Docker Engine
13+
installed locally or not.
1414

15-
If you do not have Docker Engine installed locally, start at [Deploy app without Docker Engine installed locally](5_deploy_the_app_as_a_service.md#deploy-app-without-docker-engine-installed-locally).
15+
* If you have Docker Engine installed locally, start at
16+
[Deploy app with Docker Engine installed locally](5_deploy_the_app_as_a_service.md#deploy-app-with-docker-engine-installed-locally).
17+
18+
* If you do not have Docker Engine installed locally, start at [Deploy app without Docker Engine installed locally](5_deploy_the_app_as_a_service.md#deploy-app-without-docker-engine-installed-locally).
1619

17-
> **Note**: If you don't have Docker Engine installed locally, skip to
1820

1921
## Deploy app with Docker Engine installed locally
2022

@@ -29,42 +31,53 @@ or
2931
```bash
3032
$ docker-cloud service run -p 80 --name web $DOCKER_ID_USER/quickstart-go
3133
```
34+
3235
Skip the next section and read about [The run command](5_deploy_the_app_as_a_service.md#the-run-command).
3336

3437
## Deploy app without Docker Engine installed locally
3538

36-
If you don't have Docker Engine installed locally and you have been following this tutorial, you probably don't have either of the quickstart images in your private registry in Docker Cloud. To deploy the service without Engine installed locally, use the public images `dockercloud/quickstart-python` or `dockercloud/quickstart-go` available on Docker Hub.
39+
If you don't have Docker Engine installed locally and you have been following
40+
this tutorial, you probably don't have either of the quickstart images in your
41+
private registry in Docker Cloud. To deploy the service without Engine installed
42+
locally, use the public images `dockercloud/quickstart-python` or
43+
`dockercloud/quickstart-go` available on Docker Hub.
3744

3845
To do this execute one of the following commands:
3946

4047
**Python quickstart**
48+
4149
```bash
4250
$ docker-cloud service run -p 80 --name web dockercloud/quickstart-python
4351
```
4452

4553
**Go quickstart**
54+
4655
```bash
4756
$ docker-cloud service run -p 80 --name web dockercloud/quickstart-go
4857
```
58+
4959
Go to the next section to read about [The run command](5_deploy_the_app_as_a_service.md#the-run-command).
5060

5161
## The run command
5262

5363
The `run` command **creates and runs** the service using the image you chose. The **-p 80** flag publishes port 80 in the container so that it is publicly accessible, and maps it to a dynamically assigned port in the node.
5464

55-
It might take a minute or two to get your service up and running. Once it completes the startup process, it will be in the *running* state.
65+
It might take a minute or two to get your service up and running. Once it
66+
completes the startup process, it will be in the *running* state.
5667

5768
To check the status of your service from the CLI use the `docker-cloud service ps` command.
5869

59-
```
70+
```none
6071
$ docker-cloud service ps
6172
NAME UUID STATUS IMAGE DEPLOYED
6273
web 68a6fb2c ▶ Running my-username/quickstart-python:latest 1 hour ago
6374
```
6475

65-
Make sure that the **STATUS** for your service is **Running**. Next, visit the app at the URL generated by its service name. Find this URL by running `docker-cloud container ps`.
76+
Make sure that the **STATUS** for your service is **Running**. Next, visit the
77+
app at the URL generated by its service name. Find this URL by running
78+
`docker-cloud container ps`.
6679

67-
```
80+
```none
6881
$ docker-cloud container ps
6982
NAME UUID STATUS IMAGE RUN COMMAND EXIT CODE DEPLOYED PORTS
7083
web-1 6c89f20e ▶ Running my-username/quickstart-python:latest python app.py 1 minute ago web-1.my-username.cont.dockerapp.io:49162->80/tcp
@@ -84,4 +97,4 @@ Hello World!</br>Hostname: web-1</br>Counter: Redis Cache not found, counter dis
8497
8598
**CONGRATULATIONS!** You've deployed your first service using Docker Cloud.
8699

87-
Next: [Define environment variables](6_define_environment_variables.md).
100+
Next: [Define environment variables](6_define_environment_variables.md).

docker-cloud/getting-started/deploy-app/6_define_environment_variables.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ $ docker-cloud service set --env NAME="Friendly Users" --redeploy web
4040

4141
## Check endpoint status
4242

43-
Execute `docker-cloud container ps` again to see the container's new endpoint. You should now see two `web-1` containers, one with a status of **terminated** (that's the original container) and another one either **starting** or already **running**.
43+
Execute `docker-cloud container ps` again to see the container's new endpoint.
44+
You should now see two `web-1` containers, one with a status of **terminated**
45+
(that's the original container) and another one either **starting** or already
46+
**running**.
4447

45-
```
48+
```none
4649
$ docker-cloud container ps
4750
NAME UUID STATUS IMAGE RUN COMMAND EXIT CODE DEPLOYED PORTS
4851
web-1 a2ff2247 ✘ Terminated my-username/quickstart-python:latest python app.py 40 minutes ago web-1.my-username.cont.dockerapp.io:49165->80/tcp
@@ -53,7 +56,7 @@ Now curl the new endpoint to see the updated greeting.
5356

5457
> **Note**: If `docker-cloud container ps` doesn't show an endpoint for the container yet, wait until the container status changes to **running**.
5558
56-
```
59+
```none
5760
$ curl web-1.$DOCKER_ID_USER.cont.dockerapp.io:49162
5861
Hello Friendly Users!</br>Hostname: e360d05cdb81</br>Counter: Redis Cache not found, counter disabled.%
5962
```
@@ -62,13 +65,15 @@ Your service now returns `Hello Friendly Users!`. Great! You've modified your se
6265

6366
### Environment Variables and the Dockerfile
6467

65-
Environment variables can also be set in the Dockerfile, and modified at runtime (like you just did).
68+
Environment variables can also be set in the Dockerfile, and modified at runtime
69+
(like you just did).
6670

67-
Wondering where the default value for the **NAME** environment variable is set? Look in the quickstart's Dockerfile.
71+
Wondering where the default value for the **NAME** environment variable is set?
72+
Look in the quickstart's Dockerfile.
6873

69-
```
74+
```none
7075
# Environment Variables
7176
ENV NAME World
7277
```
7378

74-
Next, we'll try [Scaling the service](7_scale_the_service.md).
79+
Next, we'll try [Scaling the service](7_scale_the_service.md).

docker-cloud/getting-started/deploy-app/7_scale_the_service.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Right now, your service is running on a single container. That's great for now.
1111

1212
You can check how many containers are running using the `docker-cloud container ps` command.
1313

14-
```
14+
```none
1515
$ docker-cloud container ps
1616
NAME UUID STATUS IMAGE RUN COMMAND EXIT CODE DEPLOYED PORTS
1717
web-1 6c89f20e ▶ Running my-username/python-quickstart:latest python app.py 1 hour ago web-1.my-username.cont.dockerapp.io:49162->80/tcp
@@ -27,15 +27,15 @@ In this example, you can see we're scaling the service called `web` to `2` conta
2727

2828
Run `service ps` again, and you should see now see your service scaling:
2929

30-
```
30+
```none
3131
$ docker-cloud service ps
3232
NAME UUID STATUS IMAGE DEPLOYED
3333
web 68a6fb2c ⚙ Scaling my-username/python-quickstart:latest 1 hour ago
3434
```
3535

3636
If you run `container ps` you should see multiple containers:
3737

38-
```
38+
```none
3939
$ docker-cloud container ps
4040
NAME UUID STATUS IMAGE RUN COMMAND EXIT CODE DEPLOYED PORTS
4141
web-1 6c89f20e ▶ Running my-username/python-quickstart:latest python app.py 1 hour ago web-1.my-username.cont.dockerapp.io:49162->80/tcp
@@ -44,7 +44,7 @@ web-2 ab045c42 ⚙ Starting my-username/python-quickstart:lat
4444

4545
Containers aren't assigned a *PORT* until they are *running*, so you have to wait until the Service status goes from *Scaling* to *Running* to see what port is assigned to them.
4646

47-
```
47+
```none
4848
$ docker-cloud container ps
4949
NAME UUID STATUS IMAGE RUN COMMAND EXIT CODE DEPLOYED PORTS
5050
web-1 6c89f20e ▶ Running my-username/python-quickstart:latest python app.py 1 hour ago web-1.my-username.cont.dockerapp.io:49162->80/tcp
@@ -57,7 +57,7 @@ In the example output above, the URL `web-1.my-username.cont.dockerapp.io:49162`
5757

5858
If you use curl to visit the pages, you should see something like this:
5959

60-
```
60+
```none
6161
$ curl web-1.$DOCKER_ID_USER.cont.dockerapp.io:49166
6262
Hello Python Users!</br>Hostname: web-1</br>Counter: Redis Cache not found, counter disabled.%
6363
$ curl web-2.$DOCKER_ID_USER.cont.dockerapp.io:49156

docker-cloud/getting-started/deploy-app/8_view_logs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ service logs` command with the name of the service.
1414

1515
If we run `docker-cloud service logs web`, you'll see logs for both *web-1* and *web-2*, like the example below.
1616

17-
```
17+
```none
1818
$ docker-cloud service logs web
1919
[web-1] 2015-01-13T22:45:37.250431077Z * Running on http://0.0.0.0:80/
2020
[web-1] 2015-01-07T17:20:19.076174813Z 83.50.33.64 - - [07/Jan/2015 17:20:19] "GET / HTTP/1.1" 200 -
@@ -26,7 +26,7 @@ $ docker-cloud service logs web
2626

2727
To see a specific container's logs, use the `container logs` and the specific container's name. To learn more about service and container hostnames, see [Service Discovery](../../apps/service-links.md#using-service-and-container-names-as-hostnames).
2828

29-
```
29+
```none
3030
$ docker-cloud container logs web-1
3131
2015-01-07T17:18:24.550419508Z * Running on http://0.0.0.0:80/
3232
2015-01-07T17:20:19.076174813Z 83.50.33.64 - - [07/Jan/2015 17:20:19] "GET / HTTP/1.1" 200 -
@@ -36,4 +36,4 @@ $ docker-cloud container logs web-1
3636

3737
Visit your application using curl or your browser again. Run the `service logs web` command again, and you will see another log message for your visit.
3838

39-
Next, let's explore how to [Load balance the service](9_load-balance_the_service.md).
39+
Next, let's explore how to [Load balance the service](9_load-balance_the_service.md).

docker-cloud/getting-started/deploy-app/9_load-balance_the_service.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,13 @@ web-2 ab045c42 ▶ Running my-username/quickstart-python:late
5858
lb-1 9793e58b ▶ Running dockercloud/haproxy:latest /run.sh 14 minutes ago 443/tcp, lb-1.my-username.cont.dockerapp.io:80->80/tcp
5959
```
6060

61-
You should notice an URL endpoint in the *PORT* column for haproxy-1. In the example above this is `lb-1.my-username.cont.dockerapp.io:80`. Open the `lb-1` URL in your browser or curl from the CLI.
61+
You should notice an URL endpoint in the *PORT* column for haproxy-1. In the
62+
example above this is `lb-1.my-username.cont.dockerapp.io:80`. Open the `lb-1`
63+
URL in your browser or curl from the CLI.
6264

63-
If you refresh or run curl multiple times you should see requests distributed between the two containers of in the `web` service. You can see which container responds to your request in the `Hostname` section of the response.
65+
If you refresh or run curl multiple times you should see requests distributed
66+
between the two containers of in the `web` service. You can see which container
67+
responds to your request in the `Hostname` section of the response.
6468

6569
```none
6670
$ curl lb-1.$DOCKER_ID_USER.cont.dockerapp.io

0 commit comments

Comments
 (0)