Skip to content

Commit 2943f81

Browse files
Merge branch 'master' into ci-cd-bigdata-chapters
2 parents bb08ecc + 945ac68 commit 2943f81

File tree

8 files changed

+38
-23
lines changed

8 files changed

+38
-23
lines changed

beginner/chapters/votingapp.md

+6-1
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:

beginner/chapters/webapps.md

+8-8
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/chapters/ch01-setup.adoc

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,16 +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

1417
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.
1518

16-
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].
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].
1720

1821
=== Additional components
1922

@@ -23,7 +26,7 @@ Install the following additional components:
2326

2427
=== Docker Toolbox Notes
2528

26-
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.
2730

2831
. *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.
2932
+
@@ -36,7 +39,7 @@ docker-machine ip default
3639
This will provide the IP address associated with the Docker Machine created by Toolbox.
3740
+
3841
Edit `/etc/hosts` (Mac OS) or `C:\Windows\System32\drivers\etc\hosts` (Windows) and add:
39-
42+
+
4043
[source, text]
4144
----
4245
<IP ADDRESS> dockerhost

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

+6
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,16 @@ 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+
54+
The following output is shown:
55+
5056
[source, text]
5157
----
5258
Sending build context to Docker daemon 2.048 kB

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

+1-1
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

+1-1
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

+5-4
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
+

windows/windows-containers/MultiContainerApp.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Multi-Container Applications
22

3-
This tutorial will walk you through using the sample Music Store application with Windows containers. The Music Store application is a standard .NET sample application, available in the [aspnet GitHub repository](https://github.com/aspnet/MusicStore "Music Store application"). We've [forked it](https://github.com/friism/MusicStore "link to forked version of Music Store App") to use Windows Containers.
3+
This tutorial will walk you through using the sample Music Store application with Windows containers. The Music Store application is a standard .NET sample application, available in the [aspnet GitHub repository](https://github.com/aspnet/MusicStore "Music Store application"). We've [forked it](https://github.com/dockersamples/dotnet-musicstore "link to forked version of Music Store App") to use Windows Containers.
44

55
## Using docker-compose on Windows
66
Docker Compose is a great way develop complex multi-container consisting of databases, queues and web frontends.
@@ -14,7 +14,7 @@ Invoke-WebRequest https://github.com/docker/compose/releases/download/1.11.1/doc
1414
To try out Compose on Windows, clone a variant of the ASP.NET Core MVC MusicStore app, backed by a SQL Server Express 2016 database.
1515

1616
```
17-
git clone https://github.com/friism/Musicstore
17+
git clone https://github.com/dockersamples/dotnet-musicstore
1818
...
1919
cd Musicstore
2020
docker-compose -f .\docker-compose.windows.yml build

0 commit comments

Comments
 (0)