Skip to content

Commit 79a4536

Browse files
Merge branch 'master' into fixes-on-previous-labs
2 parents aabbff4 + 945ac68 commit 79a4536

25 files changed

+102
-87
lines changed

12factor/03_configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ In _config/connections.js_, we define the _mongo_ connection and use MONGO_URL e
1010
module.exports.connections = {
1111
mongo: {
1212
adapter: 'sails-mongo',
13-
url: process.env.MONGO_URL'
13+
url: 'process.env.MONGO_URL'
1414
}
1515
};
1616
```

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This repo contains [Docker](https://docker.com) labs and tutorials authored both by Docker, and by members of the community. We welcome contributions and want to grow the repo.
44

55
#### Docker tutorials:
6-
* [Docker for beginners] (beginner/readme.md)
6+
* [Docker for beginners](beginner/readme.md)
77
* [Docker Swarm Mode](swarm-mode/README.md)
88
* [Configuring developer tools and programming languages](developer-tools/README.md)
99
* Java
@@ -20,7 +20,7 @@ This repo contains [Docker](https://docker.com) labs and tutorials authored both
2020

2121
#### Community tutorials
2222
* [Docker Tutorials from the Community](https://github.com/docker/community/tree/master/Docker-Meetup-Content) - links to a different repository
23-
* [Advanced Docker orchestration workshop] (https://github.com/docker/labs/tree/master/Docker-Orchestration) - links to a different repository
23+
* [Advanced Docker orchestration workshop](https://github.com/docker/labs/tree/master/Docker-Orchestration) - links to a different repository
2424

2525
For more information on Docker, see the Official [Docker documentation](https://docs.docker.com).
2626

beginner/chapters/setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Getting all the tooling setup on your computer can be a daunting task, but getti
88

99
The *getting started* guide on Docker has detailed instructions for setting up Docker on [Mac](https://docs.docker.com/docker-for-mac/), [Linux](https://docs.docker.com/engine/installation/linux/) and [Windows](https://docs.docker.com/docker-for-windows/).
1010

11-
*If you're using Docker for Windows* make sure you have [shared your drive](https://docs.docker.com/docker-for-windows/#/shared-drives).
11+
*If you're using Docker for Windows* make sure you have [shared your drive](https://docs.docker.com/docker-for-windows/#shared-drives).
1212

1313
*Important note* If you're using an older version of Windows or MacOS you may need to use [Docker Machine](https://docs.docker.com/machine/overview/) instead.
1414

beginner/chapters/votingapp.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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:
@@ -133,7 +138,7 @@ Creating service vote_worker
133138
Creating service vote_redis
134139
Creating service vote_db
135140
```
136-
to verify your stack has deployed, use `docker stack services`
141+
to verify your stack has deployed, use `docker stack services vote`
137142
```
138143
docker stack services vote
139144
ID NAME MODE REPLICAS IMAGE

beginner/chapters/webapps.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Great! So you have now looked at `docker run`, played with a Docker container an
66
77
Let's start by taking baby-steps. First, we'll use Docker to run a static website in a container. The website is based on an existing image. We'll pull a Docker image from Docker Hub, run the container, and see how easy it is to set up a web server.
88

9-
The image that you are going to use is a single-page website that was already created for this demo and is available on the Docker Hub as [`seqvence/static-site`](https://hub.docker.com/r/seqvence/static-site/). You can download and run the image directly in one go using `docker run` as follows.
9+
The image that you are going to use is a single-page website that was already created for this demo and is available on the Docker Hub as [`dockersamples/static-site`](https://hub.docker.com/r/dockersamples/static-site/). You can download and run the image directly in one go using `docker run` as follows.
1010

1111
```
12-
$ docker run -d seqvence/static-site
12+
$ docker run -d dockersamples/static-site
1313
```
1414

1515
>**Note:** The current version of this image doesn't run without the `-d` flag. The `-d` flag enables **detached mode**, which detaches the running container from the terminal/shell and returns your prompt after the container starts. We are debugging the problem with this image but for now, use `-d` even for this first example.
@@ -31,7 +31,7 @@ Since we ran the container in detached mode, we don't have to launch another ter
3131
```
3232
$ docker ps
3333
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
34-
a7a0e504ca3e seqvence/static-site "/bin/sh -c 'cd /usr/" 28 seconds ago Up 26 seconds 80/tcp, 443/tcp stupefied_mahavira
34+
a7a0e504ca3e dockersamples/static-site "/bin/sh -c 'cd /usr/" 28 seconds ago Up 26 seconds 80/tcp, 443/tcp stupefied_mahavira
3535
```
3636

3737
Check out the `CONTAINER ID` column. You will need to use this `CONTAINER ID` value, a long sequence of characters, to identify the container you want to stop, and then to remove it. The example below provides the `CONTAINER ID` on our system; you should use the value that you see in your terminal.
@@ -45,7 +45,7 @@ $ docker rm a7a0e504ca3e
4545
Now, let's launch a container in **detached** mode as shown below:
4646

4747
```
48-
$ docker run --name static-site -e AUTHOR="Your Name" -d -P seqvence/static-site
48+
$ docker run --name static-site -e AUTHOR="Your Name" -d -P dockersamples/static-site
4949
e61d12292d69556eabe2a44c16cbd54486b2527e2ce4f95438e504afb7b02810
5050
```
5151

@@ -78,7 +78,7 @@ You can now open `http://<YOUR_IPADDRESS>:[YOUR_PORT_FOR 80/tcp]` to see your si
7878
You can also run a second webserver at the same time, specifying a custom host port mapping to the container's webserver.
7979

8080
```
81-
$ docker run --name static-site-2 -e AUTHOR="Your Name" -d -p 8888:80 seqvence/static-site
81+
$ docker run --name static-site-2 -e AUTHOR="Your Name" -d -p 8888:80 dockersamples/static-site
8282
```
8383
<img src="../images/static.png" title="static">
8484

@@ -96,7 +96,7 @@ $ docker rm static-site
9696
Let's use a shortcut to remove the second site:
9797

9898
```
99-
$ docker rm -f static-site static-site-2
99+
$ docker rm -f static-site-2
100100
```
101101

102102
Run `docker ps` to make sure the containers are gone.
@@ -109,12 +109,12 @@ CONTAINER ID IMAGE COMMAND CREATED
109109

110110
In this section, let's dive deeper into what Docker images are. You will build your own image, use that image to run an application locally, and finally, push some of your own images to Docker Hub.
111111

112-
Docker images are the basis of containers. In the previous example, you **pulled** the *seqvence/static-site* image from the registry and asked the Docker client to run a container **based** on that image. To see the list of images that are available locally on your system, run the `docker images` command.
112+
Docker images are the basis of containers. In the previous example, you **pulled** the *dockersamples/static-site* image from the registry and asked the Docker client to run a container **based** on that image. To see the list of images that are available locally on your system, run the `docker images` command.
113113

114114
```
115115
$ docker images
116116
REPOSITORY TAG IMAGE ID CREATED SIZE
117-
seqvence/static-site latest 92a386b6e686 2 hours ago 190.5 MB
117+
dockersamples/static-site latest 92a386b6e686 2 hours ago 190.5 MB
118118
nginx latest af4b3d7d5401 3 hours ago 190.5 MB
119119
python 2.7 1c32174fd534 14 hours ago 676.8 MB
120120
postgres 9.4 88d845ac7a88 14 hours ago 263.6 MB

developer-tools/java-debugging/Eclipse-README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,28 @@ Try to log into the application. Look at the value for password in the Eclipse v
154154

155155
In this MVC application the UserController uses the findByLogin method in the UserServiceImpl class which uses the findByUsername method to retrieve the information from the database. It then checks to see if the password from the form matches the user password. Since the password from the login form is not scrambled using ROT13, it does not match the user password and you cannot log into the application.
156156

157-
To fix this, apply ROT13 to the password by adding
157+
To fix this, apply ROT13 to the password by adding an import near the top of the file
158158

159159
```
160-
import com.docker.UserSignup.utit.Rot13
160+
import com.docker.UserSignup.util.Rot13
161+
```
162+
163+
and replace the contents of `findByLogin` with
161164

162-
String passwd = Rot13.rot13(password);
163165
```
166+
public boolean findByLogin(String userName, String password) {
167+
User usr = userRepository.findByUserName(userName);
168+
169+
String passwd = Rot13.rot13(password);
170+
171+
if(usr != null && usr.getPassword().equals(passwd)) {
172+
return true;
173+
}
174+
175+
return false;
176+
}
177+
```
178+
164179
![](images/eclipse_debug_UserServiceImpl_code.png)
165180

166181
Set a breakpoint in UserServiceImpl on the findByLogin method. Log in again and look at the values for the breakpoint. The 'passwd' variable is `z0ol` which matches the password for the user moby.

developer-tools/java/chapters/ch01-setup.adoc

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,19 @@
44

55
This section describes the hardware and software needed for this workshop, and how to configure them. This workshop is designed for a BYOL (Brying Your Own Laptop) style hands-on-lab.
66

7-
== Hardware
7+
== Hardware & Software
88

9-
. Operating System: Mac OS X (10.10+), Windows 10 Pro+, Ubuntu 12+, CentOS 7+
10-
. Memory: At least 4 GB+, preferred 8 GB
9+
. Memory: At least 4 GB+, strongly preferred 8 GB
10+
. Operating System: Mac OS X (10.10.3+), Windows 10 Pro+ 64-bit, Ubuntu 12+, CentOS 7+.
11+
+
12+
NOTE: An older version of the operating system may be used. The installation instructions would differ slightly in that case and are explained in the next section.
13+
. Amazon Web Services credentials with https://docs.docker.com/docker-for-aws/iam-permissions/[following permissions]. This is only needed for some parts of the workshop.
1114

1215
== Install Docker
1316

14-
Docker runs natively on Mac, Windows and Linux. Follow the instructions to install Docker:
15-
16-
. https://docs.docker.com/docker-for-mac/[Mac]
17-
. https://docs.docker.com/docker-for-windows/[Windows]
18-
. https://docs.docker.com/engine/installation/linux/centos/[Centos]
19-
. https://docs.docker.com/engine/installation/linux/debian/[Debian]
20-
. https://docs.docker.com/engine/installation/linux/ubuntulinux/[Ubuntu]
21-
22-
NOTE: Docker for Mac and Windows have requirements for a fairly recent operating system version. If your machine does not meet these requirements, then you need to install https://www.docker.com/products/docker-toolbox[Docker Toolbox].
17+
Docker runs natively on Mac, Windows and Linux. This lab will use https://www.docker.com/community-edition[Docker Community Edition]. Follow the https://www.docker.com/community-edition[instructions] to install Docker.
2318

24-
Complete set of operating systems are listed at http://docs.docker.com/engine/installation/[Install Docker Engine].
19+
NOTE: Docker Community Edition have requirements for a fairly recent operating system version. If your machine does not meet these requirements, then you need to install https://www.docker.com/products/docker-toolbox[Docker Toolbox].
2520

2621
=== Additional components
2722

@@ -31,7 +26,7 @@ Install the following additional components:
3126

3227
=== Docker Toolbox Notes
3328

34-
Skip this section if you are not using Docker Toolbox for Mac or Windows.
29+
Skip this section if you are using Docker Community Edition.
3530

3631
. *Default Docker Machine*: Docker Toolbox creates a Docker Machine named `default`. To make it easier to start/stop the containers, an entry is added into the host mapping table of your operating system.
3732
+
@@ -44,7 +39,7 @@ docker-machine ip default
4439
This will provide the IP address associated with the Docker Machine created by Toolbox.
4540
+
4641
Edit `/etc/hosts` (Mac OS) or `C:\Windows\System32\drivers\etc\hosts` (Windows) and add:
47-
42+
+
4843
[source, text]
4944
----
5045
<IP ADDRESS> dockerhost

developer-tools/java/chapters/ch03-build-image.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,15 @@ This image uses `ubuntu` as the base image. `CMD` command defines the command th
4343

4444
Build the image using the command:
4545

46+
[source, text]
47+
----
4648
docker image build . -t helloworld
49+
----
4750

4851
`.` in this command is the context for `docker image build`. `-t` adds a tag to the image.
4952

53+
The following output is shown:
54+
5055
[source, text]
5156
----
5257
Sending build context to Docker daemon 2.048 kB
@@ -67,6 +72,7 @@ Removing intermediate container 7615d69d04ec
6772
Successfully built 61edf15e4cec
6873
----
6974

75+
7076
List the images available using `docker image ls`:
7177

7278
[source, text]

developer-tools/java/chapters/ch04-run-container.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ If you want the container to accept incoming connections, you will need to provi
126126

127127
[source, text]
128128
----
129-
docker container stop `docker conatiner ps | grep wildfly | awk '{print $1}'`
129+
docker container stop `docker container ps | grep wildfly | awk '{print $1}'`
130130
----
131131

132132
Restart the container as:

developer-tools/java/chapters/ch05-compose.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ In this Compose file:
6363
. Image name for each service defined using `image` attribute
6464
. The `arungupta/couchbase:travel` image starts Couchbase server, configures it using http://developer.couchbase.com/documentation/server/current/rest-api/rest-endpoints-all.html[Couchbase REST API], and loads a sample bucket
6565
. The `arungupta/couchbase-javaee:travel` image starts WildFly and deploys application WAR file built from https://github.com/arun-gupta/couchbase-javaee. Clone that project if you want to build your own image.
66-
. `envrionment` attribute defines environment variables accessible by the application deployed in WildFly. `COUCHBASE_URI` refers to the database service. This is used in the application code as shown at https://github.com/arun-gupta/couchbase-javaee/blob/master/src/main/java/org/couchbase/sample/javaee/Database.java.
66+
. `environment` attribute defines environment variables accessible by the application deployed in WildFly. `COUCHBASE_URI` refers to the database service. This is used in the application code as shown at https://github.com/arun-gupta/couchbase-javaee/blob/master/src/main/java/org/couchbase/sample/javaee/Database.java.
6767
. Port forwarding is achieved using `ports` attribute
6868
. `depends_on` attribute allows to express dependency between services. In this case, Couchbase will be started before WildFly. Application-level health are still user's responsibility.
6969

developer-tools/java/chapters/ch10-monitoring.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,14 @@ https://github.com/google/cadvisor[cAdvisor] (Container Advisor) provides resour
220220
. Run `cAdvisor`
221221
+
222222
```
223-
docker run \
224-
-d \
225-
--name=cadvisor \
226-
-p 8080:8080 \
223+
docker container run \
224+
--volume=/:/rootfs:ro \
227225
--volume=/var/run:/var/run:rw \
228226
--volume=/sys:/sys:ro \
229227
--volume=/var/lib/docker/:/var/lib/docker:ro \
228+
--publish=8080:8080 \
229+
--detach=true \
230+
--name=cadvisor \
230231
google/cadvisor:latest
231232
```
232233
+

developer-tools/nodejs/porting/2_application_image.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ WORKDIR /app
3535
RUN npm install
3636
3737
# Expose API port to the outside
38-
PORT 80
3938
EXPOSE 80
4039
4140
# Launch application

developer-tools/nodejs/porting/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This tutorial starts with a simple Node.js application (HTTP Rest API built with [Sails.js](http://sailsjs.org/)) and details the steps needed to *Dockerize* it and ensure its scalability.
44

5-
The application stores data in a MongoDB dabatase. This tutorial does not address the scaling of the MongoDB part.
5+
The application stores data in a MongoDB database. This tutorial does not address the scaling of the MongoDB part.
66

77
Note: Do not hesitate to provide any comments / feedback you may have, that will help make this tutorial better.
88

networking/A1-network-basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ NETWORK ID NAME DRIVER SCOPE
6262
ef4896538cc7 none null local
6363
```
6464

65-
The output above shows the container networks that are created as part of a standard installation of Docker 1.12.
65+
The output above shows the container networks that are created as part of a standard installation of Docker.
6666

6767
New networks that you create will also show up in the output of the `docker network ls` command.
6868

networking/concepts/06-overlay-networks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
The built-in Docker `overlay` network driver radically simplifies many of the challenges in multi-host networking. With the `overlay` driver, multi-host networks are first-class citizens inside Docker without external provisioning or components. `overlay` uses the Swarm-distributed control plane to provide centralized management, stability, and security across very large scale clusters.
55

6-
###VXLAN Data Plane
6+
### VXLAN Data Plane
77
The `overlay` driver utilizes an industry-standard VXLAN data plane that decouples the container network from the underlying physical network (the _underlay_). The Docker overlay network encapsulates container traffic in a VXLAN header which allows the traffic to traverse the physical Layer 2 or Layer 3 network. The overlay makes network segmentation dynamic and easy to control no matter what the underlying physical topology. Use of the standard IETF VXLAN header promotes standard tooling to inspect and analyze network traffic.
88

99
> VXLAN has been a part of the Linux kernel since version 3.7, and Docker uses the native VXLAN features of the kernel to create overlay networks. The Docker overlay datapath is entirely in kernel space. This results in fewer context switches, less CPU overhead, and a low-latency, direct traffic path between applications and the physical NIC.
@@ -24,7 +24,7 @@ In this diagram we see the packet flow on an overlay network. Here are the steps
2424

2525

2626

27-
###Overlay Driver Internal Architecture
27+
### Overlay Driver Internal Architecture
2828
The Docker Swarm control plane automates all of the provisioning for an overlay network. No VXLAN configuration or Linux networking configuration is required. Data-plane encryption, an optional feature of overlays, is also automatically configured by the overlay driver as networks are created. The user or network operator only has to define the network (`docker network create -d overlay ...`) and attach containers to that network.
2929

3030
<span class="float-right">
@@ -89,6 +89,6 @@ Two interfaces have been created inside the container that correspond to two bri
8989

9090

9191

92-
> The Docker Overlay driver has existed since Docker Engine 1.9, and an external K/V store was required to manage state for the network. Docker Engine 1.12 integrated the control plane state into Docker Engine so that an external store is no longer required. 1.12 also introduced several new features including encryption and service load balancing. Networking features that are introduced require a Docker Engine version that supports them, and using these features with older versions of Docker Engine is not supported.
92+
> The Docker Overlay driver has existed since Docker Engine 1.9, and an external K/V store was required to manage state for the network. Docker 1.12 integrated the control plane state into Docker Engine so that an external store is no longer required. 1.12 also introduced several new features including encryption and service load balancing. Networking features that are introduced require a Docker Engine version that supports them, and using these features with older versions of Docker Engine is not supported.
9393
94-
Next: **[MACVLAN](07-macvlan.md)**
94+
Next: **[MACVLAN](07-macvlan.md)**

0 commit comments

Comments
 (0)