Skip to content

Commit

Permalink
using imagesdir
Browse files Browse the repository at this point in the history
  • Loading branch information
arun-gupta committed Aug 14, 2015
1 parent 361ae4b commit 4f18d44
Show file tree
Hide file tree
Showing 14 changed files with 116 additions and 115 deletions.
2 changes: 1 addition & 1 deletion chapters/docker-basics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Docker has three main components:
In order for these three components to work together, there is *Docker Daemon* that runs on a host machine and does the heavy lifting of building, running, and distributing Docker containers. In addition, there is *Client* that is a Docker binary which accepts commands from the user and communicates back and forth with the daemon.

.Docker architecture
image::chapters/images/docker-architecture.png[]
image::docker-architecture.png[]

Client communicates with Daemon, either co-located on the same host, or on a different host. It requests the Daemon to pull an image from the repository using `pull` command. The Daemon then downloads the image from Docker Hub, or whatever registry is configured. Multiple images can be downloaded from the registry and installed on Daemon host. Images are run using `run` command to create containers on demand.

Expand Down
2 changes: 1 addition & 1 deletion chapters/docker-compose.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ mysqldb_1 | 2015-06-05 15:40:18 1 [Warning] IP address '172.17.0.24' could not
. Access the application at http://dockerhost:8080/employees/resources/employees/. This is shown in the browser as:

.Output From Servers Run Using Docker Compose
image::chapters/images/docker-compose-output.png[]
image::docker-compose-output.png[]

### Stop Services

Expand Down
2 changes: 1 addition & 1 deletion chapters/docker-container-linking.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<<JavaEE7_PreBuilt_WAR>> explained how to use an in-memory database with the application server. This gets you started rather quickly but becomes a bottleneck soon as the database is only in-memory. This means that any changes made to your schema and data are lost when the application server shuts down. In this case, you need to use a database server that resides outside the application server. For example, MySQL as the database server and WildFly as the application server.

.Two Containers On Same Docker Host
image::chapters/images/javaee7-hol-container-linking.png[]
image::javaee7-hol-container-linking.png[]

This section will show how https://docs.docker.com/userguide/dockerlinks/[Docker Container Linking] can be used to connect to a service running inside a Docker container via a network port.

Expand Down
6 changes: 3 additions & 3 deletions chapters/docker-container.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ At first, the top read-write layer has nothing in it, but any time a process cre
We call the union of the read-write layer and all the read-only layers a _union file system_.
.Docker Layers
image::chapters/images/plain-wildfly0.png[]
image::plain-wildfly0.png[]
====

In our particular case, the https://github.com/jboss-dockerfiles/wildfly/blob/master/Dockerfile[jboss/wildfly] image extends the https://github.com/jboss-dockerfiles/base/blob/master/Dockerfile[jboss/base-jdk:7] image which adds the OpenJDK distribution on top of the https://github.com/jboss-dockerfiles/base/blob/master/Dockerfile[jboss/base] image.
Expand Down Expand Up @@ -205,7 +205,7 @@ See more about networking on the Docker website link:https://docs.docker.com/art
Now we're ready to test http://dockerhost:8080 again. This works with the exposed port, as expected.

.Welcome WildFly
image::chapters/images/plain-wildfly1.png[]
image::plain-wildfly1.png[]

[[Enabling_WildFly_Administration]]
### Enabling WildFly Administration
Expand Down Expand Up @@ -259,7 +259,7 @@ The username/password credentials are:
This shows the admin console as:

.Welcome WildFly
image::chapters/images/wildfly-admin-console.png[]
image::wildfly-admin-console.png[]

##### Additional Ways To Find Port Mapping

Expand Down
32 changes: 16 additions & 16 deletions chapters/docker-deployment-options.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,36 +50,36 @@ Start JBoss Developer Studio, if not already started.
. Select '`Servers`' tab, create a new server adapter
+
.Server adapter
image::chapters/images/jbds1.png[]
image::jbds1.png[]
+
. Assign an existing or create a new WildFly 9.0.0 runtime (changed properties are highlighted.)
+
.WildFly Runtime Properties
image::chapters/images/jbds2.png[]
image::jbds2.png[]
+
. If a new runtime needs to be created, pick the directory for WildFly 9.0.0:
+
.WildFly 9.0.0.Final Runtime
image::chapters/images/jbds3.png[]
image::jbds3.png[]
+
Click on '`Finish`'.
+
. Double-click on the newly selected server to configure server properties:
+
.Server properties
image::chapters/images/jbds4.png[]
image::jbds4.png[]
+
The host name is specified to '`dockerhost`'. Two properties on the left are automatically propagated from the previous dialog. Additional two properties on the right side are required to disable to keep deployment scanners in sync with the server.
+
. Specify a custom deployment folder on Deployment tab of Server Editor
+
.Custom deployment folder
image::chapters/images/jbds5.png[]
image::jbds5.png[]
+
. Right-click on the newly created server adapter and click '`Start`'.
+
.Started server
image::chapters/images/jbds6.png[]
image::jbds6.png[]

### Deploy Application Using Shared Volumes

Expand All @@ -89,7 +89,7 @@ image::chapters/images/jbds6.png[]
The project runs and displays the start page of the application.

.Start Server
image::chapters/images/jbds7.png[]
image::jbds7.png[]

Congratulations!

Expand Down Expand Up @@ -143,7 +143,7 @@ Now you've sucessfully used the CLI to remote deploy the Java EE 7 sample applic
WildFly comes with a web-based administration console. It also relies on the same management APIs that are used by JBoss Developer Tools and the CLI. It provides a simple and easy to use web-based console to manage WildFly instance. For a Docker image, it needs to be explicitly enabled as explained in <<Enabling_WildFly_Administration>>. Once enabled, it can be accessed at http://dockerhost:9990.

.WildFly Web Console
image::chapters/images/console1.png[]
image::console1.png[]

Username and password credentials are shown in <<WildFly_Administration_Credentials>>.

Expand All @@ -159,7 +159,7 @@ Deploy the application using the console with the following steps:
. Go to '`Deployments`' tab.
+
.Deployments tab in WildFly Web Console
image::chapters/images/wildfly9-deployments-tab.png[]
image::wildfly9-deployments-tab.png[]
+
. Click on '`Add`' button.
. On '`Add Deployment`' screen, take the default of '`Upload a new deployment`' and click '`Next>>`'.
Expand All @@ -168,17 +168,17 @@ image::chapters/images/wildfly9-deployments-tab.png[]
. Select '`Enable`' checkbox.
+
.Enable a deployment
image::chapters/images/wildfly9-add-deployments.png[]
image::wildfly9-add-deployments.png[]
+
. Click '`Finish`'.
+
.Java EE 7 Simple Sample Deployed
image::chapters/images/wildfly9-javaee7-simple-sample-deployed.png[]
image::wildfly9-javaee7-simple-sample-deployed.png[]

This will complete the deployment of the Java EE 7 application using Web Console. The output can be seen out http://dockerhost:8080/javaee7-simple-sample and looks like:

.Java EE 7 Simple Sample Output
image::chapters/images/wildfly9-javaee7-simple-sample-output.png[]
image::wildfly9-javaee7-simple-sample-output.png[]

### Deploy Application Using Management API

Expand All @@ -195,24 +195,24 @@ In addition to application port 8080, the administration port 9990 is exposed as
+
. Create a new server adapter in JBoss Developer Studio and name it "`WildFly 9.0.0-Management`". Specify the host name as '`dockerhost`'.
+
image::chapters/images/jbds8.png[]
image::jbds8.png[]
+
. Click on '`Next>`' and change the values as shown.
+
.Create New Server Adapter
image::chapters/images/jbds9.png[]
image::jbds9.png[]
+
. Take the default values in '`Remote System Integration`' and click on '`Finish`'.
+
. Change server properties by double clicking on the newly created server adapter. Specify admin credentials (username: docker, password: docker#admin). Note, you need to delete the existing password and use this instead:
+
.Management Login Credentials
image::chapters/images/jbds10.png[]
image::jbds10.png[]
+
. Right-click on the newly created server adapter and click '`Start`'. Status quickly changes to '`Started`' as shown.
+
.Synchronized WildFly Server
image::chapters/images/jbds11.png[]
image::jbds11.png[]
+
. Right-click on the javaee7-simple-sample project, select '`Run on Server`' and choose this server. The project runs and displays the start page of the application.
. Stop WildFly when you're done.
Expand Down
34 changes: 17 additions & 17 deletions chapters/docker-eclipse.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ Alternatively, download http://www.eclipse.org/downloads/index-developer-default
Specify the '`Name:`' as "`Docker Nightly`" and '`Location:`' as http://download.eclipse.org/linuxtools/updates-docker-nightly/.
+
.Add Docker Tooling To JBoss Developer Studio
image::chapters/images/jbds-docker-tools1.png[]
image::jbds-docker-tools1.png[]
+
. Expand Linux Tools, select '`Docker Client`' and '`Docker Tooling`'.
+
.Add Docker Tooling
image::chapters/images/jbds-docker-tools-nightly-setup.png[]
image::jbds-docker-tools-nightly-setup.png[]
+
. Click on '`Next >`', '`Next >`', accept the terms of the license agreement, and click on '`Finish`'. This will complete the installation of plugins.
+
Expand All @@ -33,16 +33,16 @@ The Docker Explorer provides a wizard to establish a new connection to a Docker

. Use the menu '`Window`', '`Show View`', '`Other...`'. Type '`docker`' to see the output as:
+
image::chapters/images/jbds-docker-tools-docker-view.png[]
image::jbds-docker-tools-docker-view.png[]
+
. Select '`Docker Explorer`' to open Docker Explorer.
+
image::chapters/images/jbds-docker-tools-docker-explorer-view.png[]
image::jbds-docker-tools-docker-explorer-view.png[]
+
. Click on the link in this window to create a connection to Docker Host. Specify the settings as shown:
+
.Docker Explorer
image::chapters/images/jbds-docker-tools2.png[]
image::jbds-docker-tools2.png[]
+
Make sure to get IP address of the Docker Host as:
+
Expand All @@ -56,24 +56,24 @@ Also, make sure to specify the correct directory for `.docker` on your machine.
. Click on '`Test Connection`' to check the connection. This should show the output as:
+
.Docker Explorer
image::chapters/images/jbds-docker-tools-test-connection-output.png[]
image::jbds-docker-tools-test-connection-output.png[]
+
Click on '`OK`' and '`Finish`' to exit out of the wizard.
+
. Docker Explorer itself is a tree view that handles multiple connections and provides users with quick overview of the existing images and containers.
+
.Docker Explorer Tree View
image::chapters/images/jbds-docker-tools3.png[]
image::jbds-docker-tools3.png[]
+
. Customize the view by clicking on the arrow in toolbar:
+
.Docker Explorer Customize View
image::chapters/images/jbds-docker-tools-customize-view-option.png[]
image::jbds-docker-tools-customize-view-option.png[]
+
Built-in filters can show/hide intermediate and '`dangling`' images, as well as stopped containers.
+
.Docker Explorer Customize View Wizard
image::chapters/images/jbds-docker-tools-customize-view-wizard.png[]
image::jbds-docker-tools-customize-view-wizard.png[]

### Docker Images

Expand All @@ -88,12 +88,12 @@ Lets take a look at it.
. Use the menu '`Window`', '`Show View`', '`Other...`', select '`Docker Images`'. It shows the list of images on Docker Host:
+
.Docker Images View
image::chapters/images/jbds-docker-tools4.png[]
image::jbds-docker-tools4.png[]
+
. Right-click on the image ending with "`wildfly:latest`" and click on the green arrow in the toolbar. This will show the following wizard:
+
.Docker Run Container Wizard
image::chapters/images/jbds-docker-tools-run-container-wizard.png[]
image::jbds-docker-tools-run-container-wizard.png[]
+
By default, all exports ports from the image are mapped to random ports on the host interface. This setting can be changed by unselecting the first checkbox and specify exact port mapping.
+
Expand All @@ -102,7 +102,7 @@ Click on '`Finish`' to start the container.
. When the container is started, all logs are streamed into Eclipse Console:
+
.Docker Container Logs
image::chapters/images/jbds-docker-tools5.png[]
image::jbds-docker-tools5.png[]

### Docker Containers

Expand All @@ -111,18 +111,18 @@ Docker Containers view lets the user manage the containers. The view toolbar pro
. Use the menu '`Window`', '`Show View`', '`Other...`', select '`Docker Containers`'. It shows the list of running containers on Docker Host:
+
.Docker Containers View
image::chapters/images/jbds-docker-tools6.png[]
image::jbds-docker-tools6.png[]
+
. Pause the container by clicking on the "`pause`" button in the toolbar (https://bugs.eclipse.org/bugs/show_bug.cgi?id=469310[#469310]). Show the complete list of containers by clicking on the '`View Menu`', '`Show all containers`'.
+
.All Docker Containers
image::chapters/images/jbds-docker-tools-all-containers.png[]
image::jbds-docker-tools-all-containers.png[]
+
. Select the paused container, and click on the green arrow in the toolbar to restart the container.
. Right-click on any running container and select "`Display Log`" to view the log for this container.
+
.Eclipse Properties View
image::chapters/images/jbds-docker-tools-display-log.png[]
image::jbds-docker-tools-display-log.png[]

TODO: Users can also attach an Eclipse console to a running Docker container to follow the logs and use the STDIN to interact with it.

Expand All @@ -135,9 +135,9 @@ Eclipse Properties view is used to provide more information about the containers
Info view is shown as:
+
.Docker Container Properties View Info
image::chapters/images/jbds-docker-tools-properties-info.png[]
image::jbds-docker-tools-properties-info.png[]
+
Inspect view is shown as:
+
.Docker Container Properties View Inspect
image::chapters/images/jbds-docker-tools-properties-inspect.png[]
image::jbds-docker-tools-properties-inspect.png[]
6 changes: 3 additions & 3 deletions chapters/docker-javaee7.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
https://github.com/javaee-samples/javaee7-hol[Java EE 7 Movieplex] is a standard multi-tier enterprise application that shows design patterns and anti-patterns for a typical Java EE 7 application.

.Java EE 7 Application Architecture
image::chapters/images/javaee7-hol.png[]
image::javaee7-hol.png[]

Pull the Docker image that contains WildFly and pre-built Java EE 7 application WAR file as shown:

Expand All @@ -27,12 +27,12 @@ ifdef::public[docker run -it -p 8080:8080 arungupta/javaee7-hol]
See the application in action at http://dockerhost:8080/movieplex7/. The output is shown:

.Java EE 7 Application Output
image::chapters/images/javaee7-movieplex7.png[]
image::javaee7-movieplex7.png[]

This uses an in-memory database with WildFly application server as shown in the image:

.In-memory Database
image::chapters/images/javaee7-hol-in-memory-database.png[]
image::javaee7-hol-in-memory-database.png[]

Only two changes are required to the standard `jboss/wildfly` image:

Expand Down
10 changes: 5 additions & 5 deletions chapters/docker-kubernetes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ At a very high level, there are three key components:
A picture is always worth a thousand words and so this is a high-level logical block diagram for Kubernetes:

.Kubernetes Key Components
image::chapters/images/kubernetes-key-components.png[]
image::kubernetes-key-components.png[]

After the 50,000 feet view, lets fly a little lower at 30,000 feet and take a look at how Kubernetes make all of this happen. There are a few key components at Master and Minion that make this happen.

Expand Down Expand Up @@ -134,18 +134,18 @@ By default, the Vagrant setup will create a single kubernetes-master and 1 kuber
NOTE: By default, only one minion is created. This can be manipulated by setting an environment variable NUM_MINIONS variable to an integer before invoking `kube-up.sh` script.
+
.Kubernetes Cluster using Vagrant
image::chapters/images/kubernetes-cluster-vagrant.png[]
image::kubernetes-cluster-vagrant.png[]
+
By default, each VM in the cluster is running Fedora, Kubelet is installed into ``systemd'', and all other Kubernetes services are running as containers on Master.
+
. Access https://10.245.1.2 (or whatever IP address is assigned to your kubernetes cluster start up log). This may present the warning as shown below:
+
image::chapters/images/kubernetes-master-default-output-certificate.png[]
image::kubernetes-master-default-output-certificate.png[]
+
Click on '`Advanced`' and then on '`Proceed to 10.245.1.2`' to see the output as:
+
.Kubernetes Output from Master
image::chapters/images/kubernetes-master-default-output.png[]
image::kubernetes-master-default-output.png[]
+
Use '`vagrant`' as the username and '`vagrant`' as the password.
+
Expand Down Expand Up @@ -190,7 +190,7 @@ Pods, and the IP addresses assigned to them, are ephemeral. If a pod dies then K
Kubernetes services is an abstraction which defines a logical set of pods. A service is typically back-ended by one or more physical pods (associated using labels), and it has a permanent IP address that can be used by other pods/applications. For example, WildFly pod can not directly connect to a MySQL pod but can connect to MySQL service. In essence, Kubernetes service offers clients an IP and port pair which, when accessed, redirects to the appropriate backends.

.Kubernetes Service
image::chapters/images/kubernetes-service.png[]
image::kubernetes-service.png[]

NOTE: In this case, all the pods are running on a single minion. This is because, that is the default number for a Kubernetes cluster. The pod can very be on another minion if more number of minions are configured to start in the cluster.

Expand Down
8 changes: 4 additions & 4 deletions chapters/docker-mod-cluster.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A frequent requirement for Java EE based applications is running them on a clust
The diagram below shows what will be achieved in this section:

.Standalone Cluster with WildFly and mod_cluster
image::chapters/images/wildfly_cluster1.png[]
image::wildfly_cluster1.png[]

. Start Apache HTTPD server
+
Expand All @@ -18,7 +18,7 @@ docker run -d --name modcluster -p 80:80 classroom.example.com:5000/mod_cluster
. Open http://dockerhost/mod_cluster_manager in your browser to see the empty console as:
+
.Apache HTTPD runing mod_cluster_manager interface
image::chapters/images/wildfly_cluster2.png[]
image::wildfly_cluster2.png[]
+
. Start Postgres database container, if not already running:
+
Expand All @@ -37,12 +37,12 @@ docker run -d --name server1 --link db:db --link modcluster:modcluster classroom
Besides linking the database container using `--link db:db`, we also link the ``modcluster'' container. This should be done rather quickly and if you now revisit the http://dockerhost/mod_cluster_manager/[mod_cluster_manager] in your browser, then you can see that the first server was registered with the loadbalancer:
+
.First WildFly instance registered with Load Balancer
image::chapters/images/wildfly_cluster3.png[]
image::wildfly_cluster3.png[]
+
. To make sure the Ticket Monster application is also running just visit http://dockerhost/ticket-monster and you will be presented with the Ticket Monster welcome screen.
+
.Clustered Ticket Monster Application
image::chapters/images/wildfly_cluster4.png[]
image::wildfly_cluster4.png[]
+
. Start as many WildFly instances as you want (and your computer memory can handle):
+
Expand Down
Loading

0 comments on commit 4f18d44

Please sign in to comment.