Skip to content

Commit 8ad2207

Browse files
committed
Adding CLI Deployment
1 parent 3cd8f65 commit 8ad2207

5 files changed

Lines changed: 69 additions & 7 deletions

File tree

images/jbds10.png

38.6 KB
Loading

images/jbds7.png

69.2 KB
Loading

images/jbds8.png

175 KB
Loading

images/jbds9.png

53.3 KB
Loading

readme.adoc

Lines changed: 69 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,6 @@ Docker also has a linking system that allows you to link multiple containers tog
300300
See more about container communication on the Docker website link:https://docs.docker.com/userguide/dockerlinks/[Linking Containers Together]
301301
===============================
302302

303-
TODO: do we need to talk more about container linking?
304-
http://blog.arungupta.me/docker-mysql-persistence/
305-
http://blog.arungupta.me/docker-container-linking-across-multiple-hosts-techtip69/
306-
307-
308303
The "-v" flag maps a local directory into the host. This will be the place to put the deployments. Please make sure to use `-v /c/Users/` notation for drive letters on windows.
309304
The other options are known to you already.
310305
Check the logs if the server is started.
@@ -353,19 +348,86 @@ image::images/jbds6.png[]
353348

354349
Congratulations! You've just deployed your first application to a WildFly running in a Docker container.
355350

356-
Stop wildfly
351+
Stop wildfly when you're done.
357352
[source, text]
358353
----
359354
docker stop wildfly
360355
----
361356

362357
### Other Deployment options
363-
Let's explore deeper, what other deployment options we have
358+
For the first deployment we used a shared volumen on the host computer. Let's explore deeper, what other deployment options we have
364359

365360
**Deployment to WildFly Container using Management API**
366361

362+
A standalone WildFly process, process can be configured to listen for remote management requests using its "native management interface".
363+
The CLI tool that comes with the application server uses this interface, and user can develop custom clients that use it as well. In order to use this, the wildfly management interface listen IP needs to be changed from 127.0.0.1 to 0.0.0.0 which basically means, that it is not only listening on the localhost but also on all publicly assigned IP addresses.
364+
365+
The database server is still up an running. Now we're starting another WildFly instance again:
366+
[source, text]
367+
----
368+
docker run -d --name wildfly -p 8080:8080 -p 9990:9990 --link db:db <INSTRUCTOR_IP>:5000/wildfly-management
369+
----
370+
As you can see, there is no mapped volume in this case but an additional port exposed. The WildFly image that is used makes ist easier for you to play around with the deployment via the management API. It has a tweaked start script which changes the management interface according to the behavior described in the first sentence.
371+
Now go and create another new server adapter in JBoss Developer Studio.
372+
373+
.Create New Server Adapter
374+
image::images/jbds7.png[]
375+
376+
Keep the defaults in the adapter properties.
377+
378+
.Adapter Properties
379+
image::images/jbds8.png[]
380+
381+
Set up server properties by specifying the admin credentials (Admin#70365). Note, you need to delete the existing password and use this instead:
382+
383+
.Management Login Credentials
384+
image::images/jbds9.png[]
385+
386+
Right-click on the newly created server adapter and click “Start”.Status quickly changes to “Started, Synchronized” as shown.
387+
388+
.Start Server
389+
image::images/jbds10.png[]
390+
391+
Now you need to right-click, Run on Server on the ticket-monster application and chose this server.
392+
The project runs and displays the start page of ticket-monster.
393+
394+
Keep the WildFly instance up and running this time. We will re-use it for the next deployment option.
395+
367396
**Using the CLI**
368397

398+
The Command Line Interface (CLI) is a tool for connecting to WildFly instances to manage all tasks from command line environment. Some of the tasks that you can do using the CLI are:
399+
400+
. Deploy/Undeploy web application in standalone/Domain Mode.
401+
. View all information about the deployed application on runtime.
402+
. Start/Stop/Restart Nodes in respective mode i.e. Standalone/Domain.
403+
. Adding/Deleting resource or subsystems to servers.
404+
405+
In order to work with the CLI you need to have it locally installed on your machine. Your instructor has a download prepared for you at http://<INSTRUCTOR_IP:8082>/downloads/
406+
Unzip into a folder of your choice (e.g. /Users/arungupta/WildFly82/). This folder is named $WIDLFY_HOME from here on. Make sure to add the /Users/arungupta/WildFly82/bin to your path environment variable.
407+
408+
[source, text]
409+
----
410+
# Windows Example
411+
set PATH=%PATH%;%WILDFLY_HOME%/bin
412+
----
413+
414+
Now run the `jboss-cli` command and connect to the running WildFly instance.
415+
416+
[source, text]
417+
----
418+
cd %WIDLFY_HOME%/bin
419+
./jboss-cli.sh --controller=dockerhost:9990 -u=admin -p=docker#admin -c
420+
----
421+
422+
Once that you're connected through the `jboss-cli`, run:
423+
424+
[source, text]
425+
----
426+
deploy <TICKET_MONSTER_PATH>/ticket-monster.war --force
427+
----
428+
429+
Now you've been sucessfully using the CLI to remotely deploy the ticket-monster application to a running docker container.
430+
369431
**Using the web console**
370432

371433
http://blog.arungupta.me/deploy-wildfly-docker-eclipse/

0 commit comments

Comments
 (0)