Skip to content

Commit 30ea839

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 6cc61b0 + 4a1b82c commit 30ea839

File tree

751 files changed

+69581
-3551
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

751 files changed

+69581
-3551
lines changed

.github/ISSUE_TEMPLATE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
** PLEASE ONLY USE THIS ISSUE TRACKER TO SUBMIT ISSUES WITH THE DOCKER LABS TUTORIAL CONTENT **
22

3-
* If you have a bug working with Docker itself, not related to these labs, please file the bug on the [Docker repo](https://github.com/docker/docker) *
3+
* If you have a bug working with Docker itself, not related to these labs, please file the bug on the [Docker repo](https://github.com/moby/moby) *
44
* If you would like general support figuring out how to do something with Docker, please use the Docker Slack channel. If you're not on that channel, sign up for the [Docker Community](http://dockr.ly/MeetUp) and you'll get an invite. *
55
* Or go to the [Docker Forums](https://forums.docker.com/) *
66

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.vscode/
2+
.DS_Store

12factor/03_configuration.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ Configuration (credentials, database connection string, ...) should be stored in
66

77
In _config/connections.js_, we define the _mongo_ connection and use MONGO_URL environment variable to pass the mongo connection string.
88

9-
```
9+
```node
1010
module.exports.connections = {
1111
mongo: {
12-
adapter: 'sails-mongo',
13-
url: 'process.env.MONGO_URL'
12+
adapter: 'sails-mongo',
13+
url: process.env.MONGO_URL
1414
}
1515
};
1616
```
1717

1818
In _config/model.js_, we make sure the _mongo_ connection defined above is the one used.
1919

20-
```
20+
```node
2121
module.exports.models = {
22-
connection: mongo,
23-
migrate: 'safe'
22+
connection: 'mongo',
23+
migrate: 'safe'
2424
};
2525
```
2626

12factor/04_external_services.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ This ensure the application is loosely coupled with the services so it can easil
1111

1212
## What does that mean for our application ?
1313

14-
At this point, the only external service the application is using is MongoDB database. The loosely coupling is already done by the MONGO_URL used to pass the connection string.
14+
At this point, the only external service the application is using is MongoDB database. The loose coupling is already done by the MONGO_URL used to pass the connection string.
1515

16-
If something wrong happens with our instance of MongoDB (assuming a single instance is used, which is generally a bad idea...), we can easily switch to a new instance, providing a new MONGO_URL environment variable and restart the application.
16+
If something wrong happens with our instance of MongoDB (assuming a single instance is used, which is generally a bad idea...), we can easily switch to a new instance, providing a new MONGO_URL environment variable and restarting the application.
1717

1818
[Previous](03_configuration.md) - [Next](05_build_release_run.md)

12factor/08_concurrency.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The app can be seen as a set of processes of different types
77
* worker
88
* cron
99

10-
Each process needs to be able to scale horizontally, it can have it's own internal multiplexing.
10+
Each process needs to be able to scale horizontally, it can have its own internal multiplexing.
1111

1212
## What does that mean for our application ?
1313

12factor/09_disposability.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Our application exposes HTTP endPoints that are easy and quick to handle. If we
1515

1616
Kafka stores indexes of events processed by each worker. When a worker is restared, it can provide an index indicating at which point in time it needs to restart the event handling. Doing so no events are lost.
1717

18-
[Docker Hub](https://hub.docker.com) offers several image of Kafka ([Spotify](https://hub.docker.com/r/spotify/kafka/), [Wurstmeister](https://hub.docker.com/r/wurstmeister/kafka/), ...) that can easily be integrated in the docker-compose file of the application.
18+
[Docker Store](https://store.docker.com) offers several image of Kafka ([Spotify](https://store.docker.com/community/images/spotify/kafka), [Wurstmeister](https://store.docker.com/community/images/wurstmeister/kafka), ...) that can easily be integrated in the docker-compose file of the application.
1919

2020
Below is an example of how Kafka (and zookeeper) could be added to our docker-compose file. Of course, this means the application has been slightly changed to be able to write and read to/from Kafka.
2121

12factor/10_dev_prod_parity.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The different environments must be as close as possible.
44

55
Docker is very good at reducing the gap as the same services can be deployed on the developer machine as they could on any Docker Hosts.
66

7-
A lot of external services are available on the Docker Hub and can be used in an existing application. Using those components enables a developer to use Postgres in development instead of SQLite or other lighter alternative. This reduces the risk of small differences that could show up later, when the app is on production.
7+
A lot of external services are available on the Docker Store and can be used in an existing application. Using those components enables a developer to use Postgres in development instead of SQLite or other lighter alternative. This reduces the risk of small differences that could show up later, when the app is on production.
88

99
This factor shows an orientation toward continuous deployment, where development can go from dev to production in a very short timeframe, thus avoiding the big bang effect at each release.
1010

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@ This repo contains [Docker](https://docker.com) labs and tutorials authored both
1616
* [Building a 12 Factor app with Docker](12factor/README.md)
1717
* [Docker Security](security/README.md)
1818
* [Docker Networking](networking/)
19+
* [Hands-on Labs from DockerCon US 2017](dockercon-us-2017/)
1920

2021

2122
#### Community tutorials
22-
* [Docker Tutorials from the Community](https://github.com/docker/community/tree/master/Docker-Meetup-Content) - links to a different repository
23+
* [Docker Tutorials from the Community](https://github.com/docker/community/blob/master/curated-content.md) - links to a different repository
2324
* [Advanced Docker orchestration workshop](https://github.com/docker/labs/tree/master/Docker-Orchestration) - links to a different repository
2425

25-
For more information on Docker, see the Official [Docker documentation](https://docs.docker.com).
26-
2726
#### Contributing
2827

2928
We want to see this repo grow, so if you have a tutorial to submit, or contributions to existing tutorials, please see this guide:

beginner/chapters/alpine.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ drwxr-xr-x 5 root root 4096 Mar 2 16:20 lib
3030
......
3131
......
3232
```
33-
What happened? Behind the scenes, a lot of stuff happened. When you call `run`, the Docker client finds the image (alpine in this case), creates the container and then runs a command in that container. When you run `docker run alpine`, you provided a command (`ls -l`), so Docker started the command specified and you saw the listing.
33+
What happened? Behind the scenes, a lot of stuff happened. When you call `run`,
34+
1. The Docker client contacts the Docker daemon
35+
2. The Docker daemon checks local store if the image (alpine in this case) is available locally, and if not, dowloads it from Docker Store. (Since we have issued `docker pull alpine` before, the download step is not necessary)
36+
3. The Docker daemon creates the container and then runs a command in that container.
37+
4. The Docker daemon streams the output of the command to the Docker client
38+
39+
When you run `docker run alpine`, you provided a command (`ls -l`), so Docker started the command specified and you saw the listing.
3440

3541
Let's try something more exciting.
3642

@@ -87,7 +93,7 @@ In the last section, you saw a lot of Docker-specific jargon which might be conf
8793
- *Containers* - Running instances of Docker images — containers run the actual applications. A container includes an application and all of its dependencies. It shares the kernel with other containers, and runs as an isolated process in user space on the host OS. You created a container using `docker run` which you did using the alpine image that you downloaded. A list of running containers can be seen using the `docker ps` command.
8894
- *Docker daemon* - The background service running on the host that manages building, running and distributing Docker containers.
8995
- *Docker client* - The command line tool that allows the user to interact with the Docker daemon.
90-
- *Docker Hub* - A [registry](https://hub.docker.com/explore/) of Docker images. You can think of the registry as a directory of all available Docker images. You'll be using this later in this tutorial.
96+
- *Docker Store* - A [registry](https://store.docker.com/) of Docker images, where you can find trusted and enterprise ready containers, plugins, and Docker editions. You'll be using this later in this tutorial.
9197

9298
## Next Steps
9399
For the next step in the tutorial, head over to [2.0 Webapps with Docker](./webapps.md)

beginner/chapters/setup.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Setup
22

33
### Prerequisites
4-
There are no specific skills needed for this tutorial beyond a basic comfort with the command line and using a text editor. Prior experience in developing web applications will be helpful but is not required. As you proceed further along the tutorial, we'll make use of [Docker Hub](https://hub.docker.com/).
4+
There are no specific skills needed for this tutorial beyond a basic comfort with the command line and using a text editor. Prior experience in developing web applications will be helpful but is not required. As you proceed further along the tutorial, we'll make use of [Docker Cloud](https://cloud.docker.com/).
55

66
### Setting up your computer
77
Getting all the tooling setup on your computer can be a daunting task, but getting Docker up and running on your favorite OS has become very easy.

beginner/chapters/votingapp.md

+17-4
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ cd example-voting-app
2121
```
2222

2323
### 3.1 Deploying the app
24-
For this first stage, we will use existing images that are in Docker Hub.
24+
For this first stage, we will use existing images that are in Docker Store.
2525

26-
This app relies on [Docker Swarm mode](https://docs.docker.com/engine/swarm/). Swarm mode is the cluster management and orchestration features embedded in the Docker. You can easily deploy to a swarm using a file that declares your desired state for the app. Swarm allows you to run your containers on more than one machine. In this tutorial, you can run on just one machine, or you can use something like [Docker for AWS](https://beta.docker.com/) or [Docker for Azure](https://beta.docker.com/) to quickly create a multiple node machine. Alternately, you can use Docker Machine to create a number of local nodes on your development machine. See [the Swarm Mode lab](../../swarm-mode/beginner-tutorial/README.md#creating-the-nodes-and-swarm) for more information.
26+
This app relies on [Docker Swarm mode](https://docs.docker.com/engine/swarm/). Swarm mode is the cluster management and orchestration features embedded in the Docker engine. You can easily deploy to a swarm using a file that declares your desired state for the app. Swarm allows you to run your containers on more than one machine. In this tutorial, you can run on just one machine, or you can use something like [Docker for AWS](https://beta.docker.com/) or [Docker for Azure](https://beta.docker.com/) to quickly create a multiple node machine. Alternately, you can use Docker Machine to create a number of local nodes on your development machine. See [the Swarm Mode lab](../../swarm-mode/beginner-tutorial/README.md#creating-the-nodes-and-swarm) for more information.
2727

2828
First, create a Swarm.
2929

@@ -82,7 +82,7 @@ services:
8282
depends_on:
8383
- db
8484
deploy:
85-
replicas: 2
85+
replicas: 1
8686
update_config:
8787
parallelism: 2
8888
delay: 10s
@@ -103,6 +103,8 @@ services:
103103
delay: 10s
104104
max_attempts: 3
105105
window: 120s
106+
placement:
107+
constraints: [node.role == manager]
106108
107109
visualizer:
108110
image: manomarks/visualizer
@@ -111,6 +113,9 @@ services:
111113
stop_grace_period: 1m30s
112114
volumes:
113115
- "/var/run/docker.sock:/var/run/docker.sock"
116+
deploy:
117+
placement:
118+
constraints: [node.role == manager]
114119
115120
networks:
116121
frontend:
@@ -246,5 +251,13 @@ docker stack deploy --compose-file docker-stack.yml vote
246251

247252
Now take it for a spin again. Go to the URLs you used in section [3.1](#31-deploying-the-app) and see the new votes.
248253

254+
#### 3.2.5 Remove the stack
255+
256+
Remove the stack from the swarm.
257+
258+
```
259+
docker stack rm vote
260+
```
261+
249262
### 3.3 Next steps
250-
Now that you've built some images and pushed them to docker hub, and learned the basics of Swarm mode, you can explore more of Docker by checking out [the documentation](https://docs.docker.com). And if you need any help, check out the [Docker Forums](forums.docker.com) or [StackOverflow](https://stackoverflow.com/tags/docker/).
263+
Now that you've built some images and pushed them to Docker Cloud, and learned the basics of Swarm mode, you can explore more of Docker by checking out [the documentation](https://docs.docker.com). And if you need any help, check out the [Docker Forums](forums.docker.com) or [StackOverflow](https://stackoverflow.com/tags/docker/).

0 commit comments

Comments
 (0)