You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, docker images are retrieved from https://hub.docker.com/[Docker Hub].
23
-
ifdef::classroom[This lab is congfigured such a private registry is running on instructor's machine. This allows all the attendees to get the images from that machine instead.]
24
22
25
23
You can see, that Docker is downloading the image with it's different layers.
26
24
@@ -65,8 +63,7 @@ Run WildFly container in an interactive mode.
65
63
66
64
[source, text]
67
65
----
68
-
ifdef::classroom[docker run -it classroom.example.com:5000/wildfly]
69
-
ifdef::public[docker run -it jboss/wildfly]
66
+
docker run -it jboss/wildfly
70
67
----
71
68
72
69
This will show the output as:
@@ -109,8 +106,7 @@ Restart the container in detached mode:
109
106
110
107
[source, text]
111
108
----
112
-
ifdef::classroom[docker run -d classroom.example.com:5000/wildfly]
@@ -136,8 +132,7 @@ We can check it by issuing the `docker ps` command which retrieves the images pr
136
132
----
137
133
> docker ps
138
134
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
139
-
ifdef::classroom[0bc123a8ece0 classroom.example.com:5000/wildfly:latest "/opt/jboss/wildfly/ 4 seconds ago Up 4 seconds 8080/tcp tender_wozniak]
140
-
ifdef::public[922abbb9c63a jboss/wildfly "/opt/jboss/wildfly/ 3 seconds ago Up 2 seconds 8080/tcp desperate_lovelace]
135
+
922abbb9c63a jboss/wildfly "/opt/jboss/wildfly/ 3 seconds ago Up 2 seconds 8080/tcp desperate_lovelace
141
136
----
142
137
143
138
Also try `docker ps -a` to see all the containers on this machine.
@@ -168,8 +163,7 @@ docker run -d -P jboss/wildfly
168
163
----
169
164
> docker ps
170
165
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
171
-
ifdef::classroom[4545ced66242 classroom.example.com:5000/wildfly:latest "/opt/jboss/wildfly/ 3 seconds ago Up 3 seconds 0.0.0.0:32768->8080/tcp suspicious_wozniak ]
172
-
ifdef::public[63a69bff9c69 jboss/wildfly "/opt/jboss/wildfly/ 14 seconds ago Up 13 seconds 0.0.0.0:32768->8080/tcp kickass_bohr]
166
+
63a69bff9c69 jboss/wildfly "/opt/jboss/wildfly/ 14 seconds ago Up 13 seconds 0.0.0.0:32768->8080/tcp kickass_bohr
173
167
----
174
168
175
169
The port mapping is shown in the `PORTS` column. Access the WildFly server at http://dockerhost:32768. Make sure to use the correct port number as shown in your case.
@@ -189,8 +183,7 @@ Restart the container as:
189
183
190
184
[source, text]
191
185
----
192
-
ifdef::classroom[docker run -it -p 8080:8080 classroom.example.com:5000/wildfly]
193
-
ifdef::public[docker run -it -p 8080:8080 jboss/wildfly]
186
+
docker run -it -p 8080:8080 jboss/wildfly
194
187
----
195
188
196
189
The format is `-p hostPort:containerPort`. This option maps container ports to host ports and allows other containers on our host to access them.
@@ -218,16 +211,14 @@ The following command will override the default command in Docker file, start Wi
218
211
219
212
[source, text]
220
213
----
221
-
ifdef::classroom[docker run -P -d classroom.example.com:5000/wildfly /opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0]
222
-
ifdef::public[docker run -P -d jboss/wildfly /opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0]
214
+
docker run -P -d jboss/wildfly /opt/jboss/wildfly/bin/standalone.sh -b 0.0.0.0 -bmanagement 0.0.0.0
223
215
----
224
216
225
217
Accessing WildFly Administration Console require a user in administration realm. A pre-created image, with appropriate username/password credentials, is used to start WildFly as:
226
218
227
219
[source, text]
228
220
----
229
-
ifdef::classroom[docker run -P -d classroom.example.com:5000/wildfly-management]
230
-
ifdef::public[docker run -P -d arungupta/wildfly-management]
221
+
docker run -P -d arungupta/wildfly-management
231
222
----
232
223
233
224
`-P` map any exposed ports inside the image to a random port on Docker host.
@@ -238,8 +229,7 @@ Look at the exposed ports as:
238
229
----
239
230
docker ps
240
231
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
241
-
ifdef::classroom[6f610b310a46 classroom.example.com:5000/wildfly-management:latest "/bin/sh -c '/opt/jb 6 seconds ago Up 6 seconds 0.0.0.0:32769->8080/tcp, 0.0.0.0:32770->9990/tcp determined_darwin ]
242
-
ifdef::public[af7d6914a1f9 arungupta/wildfly-management "/opt/jboss/wildfly/ 2 seconds ago Up 1 seconds 0.0.0.0:32770->8080/tcp, 0.0.0.0:32769->9990/tcp happy_bardeen]
232
+
af7d6914a1f9 arungupta/wildfly-management "/opt/jboss/wildfly/ 2 seconds ago Up 1 seconds 0.0.0.0:32770->8080/tcp, 0.0.0.0:32769->9990/tcp happy_bardeen
243
233
----
244
234
245
235
Look for the host port that is mapped in the container, `32769` in this case. Access the admin console at http://dockerhost:32769.
@@ -294,8 +284,7 @@ This management image can also be started with a pre-defined port mapping as:
294
284
295
285
[source, text]
296
286
----
297
-
ifdef::classroom[docker run -p 8080:8080 -p 9990:9990 -d classroom.example.com:5000/wildfly-management]
298
-
ifdef::public[docker run -p 8080:8080 -p 9990:9990 -d arungupta/wildfly-management]
287
+
docker run -p 8080:8080 -p 9990:9990 -d arungupta/wildfly-management
299
288
----
300
289
301
290
In this case, Docker port mapping will be shown as:
Copy file name to clipboardExpand all lines: chapters/docker-deployment-options.adoc
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,6 @@ https://github.com/javaee-samples/javaee7-simple-sample[Java EE 7 Simple Sample]
13
13
14
14
mvn clean package
15
15
16
-
ifdef::classroom[Copy the Maven `lab-settings.xml` file that you have downloaded from the instructor machine and place it inside `docker-java` directory.]
17
-
18
16
### Start Application Server
19
17
20
18
Start WildFly server as:
@@ -110,9 +108,7 @@ The Command Line Interface (CLI) is a tool for connecting to WildFly instances t
110
108
111
109
Lets use the CLI to deploy javaee7-simple-sample to WildFly running in the container.
112
110
113
-
. CLI needs to be locally installed and comes as part of WildFly. Download WildFly 9.0 from
ifdef::public[http://download.jboss.org/wildfly/9.0.0.Final/wildfly-9.0.0.Final.zip]. Unzip into a folder of your choice (e.g. `/Users/arungupta/tools/`). This will create `wildfly-9.0.0.Final` directory here. This folder is referred to $WIDLFY_HOME from here on. Make sure to add the `/Users/arungupta/tools/wildfly-9.0.0.Final/bin` to your $PATH.
111
+
. CLI needs to be locally installed and comes as part of WildFly. This should be available in the previously downloaded WildFly. Unzip into a folder of your choice (e.g. `/Users/arungupta/tools/`). This will create `wildfly-9.0.0.Final` directory here. This folder is referred to $WIDLFY_HOME from here on. Make sure to add the `/Users/arungupta/tools/wildfly-9.0.0.Final/bin` to your $PATH.
116
112
+
117
113
. Run the "`wildfly-management`" image with fixed port mapping as explained in <<Management_Fixed_Port_Mapping>>.
118
114
. Run the `jboss-cli` command and connect to the WildFly instance.
Copy file name to clipboardExpand all lines: chapters/docker-eclipse.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ The Docker tooling is aimed at providing at minimum the same basic level feature
6
6
7
7
As this is still in early access stage, you will have to install it first:
8
8
9
-
. Download and Install http://classroom.example.com:8082/downloads/jboss-devstudio-9.0.0.Beta2-v20150609-1026-B3346-installer-standalone.jar[JBoss Developer Studio 9.0 Beta 2], take defaults through out the installation.
9
+
. Use JBoss Developer Studio 9.0 Beta 2.
10
10
+
11
11
Alternatively, download http://www.eclipse.org/downloads/index-developer-default.php[Eclipse Mars latest build] and configure JBoss Tools plugin from the update site http://download.jboss.org/jbosstools/updates/nightly/mars/.
The https://github.com/arun-gupta/docker-images/blob/master/javaee7-hol/Dockerfile[javaee7-hol Dockerfile] is based on `jboss/wildfly` and adds the movieplex7 application as war file.
@@ -20,8 +19,7 @@ Run it:
20
19
21
20
[source, text]
22
21
----
23
-
ifdef::classroom[docker run -it -p 8080:8080 classroom.example.com:5000/javaee7-hol]
24
-
ifdef::public[docker run -it -p 8080:8080 arungupta/javaee7-hol]
22
+
docker run -it -p 8080:8080 arungupta/javaee7-hol
25
23
----
26
24
27
25
See the application in action at http://dockerhost:8080/movieplex7/. The output is shown:
This section describes what, how, and where to install the software needed for this lab. This lab is designed for a BYOL (Brying Your Own Laptop) style hands-on-lab.
4
4
5
-
ifdef::classroom[]
6
-
### Instructor
7
-
8
-
The instructor setup is designed to make the lab most reliable even with bad Internet connections. Most, if not all, of the software can be directly downloaded from the instructor's machine. The machine is setup as _Docker Host_ and also runs a _Docker Registry_ and Nexus container.
9
-
10
-
Follow all the https://github.com/javaee-samples/docker-java/blob/master/instructor/readme.adoc[instructor setup instructions] at least a day before the lab. Make sure there is a decent Internet connection available.
11
-
12
-
### Attendees
13
-
endif::classroom[]
14
-
15
-
ifdef::classroom[]
16
-
This section provide instructions to setup an attendee environment from an instructor's machine.
17
-
endif::classroom[]
18
-
19
5
### Hardware
20
6
21
7
. Operating System: Mac OS X (10.8 or later), Windows 7 (SP1), Fedora (21 or later)
All downloads and relevant infrastructure is setup on instructor's machine. Configure IP address of the instructor's machine into so that your machine can resolve it correctly.
36
-
37
-
Edit the `/etc/resolv.conf` (Mac OS / Linux)
38
-
39
-
[source, text]
40
-
----
41
-
nameserver <INSTRUCTOR IP>
42
-
----
43
-
44
-
On Windows, configure Domain Suffixes or DNS Suffixes as explained at http://www.pc-freak.net/blog/configure-equivalent-linux-etcresolvconf-search-domaincom-ms-windows-dns-suffixes/.
45
-
endif::classroom[]
46
-
47
17
### Git Client
48
18
49
-
ifdef::public[]
50
19
Install Git Client as explained at: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
51
-
endif::public[]
52
-
53
-
ifdef::classroom[]
54
-
Mac client: ??
55
-
Linux client: ??
56
-
Windows client is available at http://classroom.example.com:8082/downloads/Git-1.9.5-preview20150319.exe.
. Download Apache Maven from https://maven.apache.org/download.cgi.
64
24
. Unzip to a directory of your choice and add it to the `PATH`.
65
25
66
26
### VirtualBox
67
27
68
28
Docker currently runs natively on Linux. It can be configured to run in a virtual machine on Mac or Windows. This is why Virtualbox is a requirement for Mac or Windows.
Downloads are available from https://www.virtualbox.org/.
74
31
75
32
Virtual Box 5.0.0 does not allow Kubernetes cluster to be started: https://github.com/kubernetes/kubernetes/issues/12614. Make sure to download VirtualBox 4.3.30[https://www.virtualbox.org/wiki/Download_Old_Builds_4_3].
Download Vagrant from https://www.vagrantup.com/downloads.html and install.
92
46
93
47
### Docker Machine
94
48
95
49
Docker Machine makes it really easy to create Docker hosts on your computer, on cloud providers and inside your own data center. It creates servers, installs Docker on them, then configures the Docker client to talk to them.
96
50
97
-
ifdef::classroom[]
98
-
Download your binary from http://classroom.example.com:8082/downloads/docker
Substitute `<INSTRUCTOR_IP>` with the IP address of the instructor's machine.
133
-
endif::classroom[]
134
-
ifdef::public[]
135
69
[source, text]
136
70
----
137
71
docker-machine create --driver=virtualbox lab
138
72
eval "$(docker-machine env lab)"
139
73
----
140
-
endif::public[]
141
74
+
142
75
. To make it easier to start/stop the containers, an entry is added into the host mapping table of your operating system. Find out the IP address of your machine:
143
76
+
@@ -159,7 +92,6 @@ This will provide the IP address associated with the Docker Machine created earl
159
92
160
93
Docker Client is used to communicate with Docker Host.
0 commit comments