Skip to content

pmuir/docker-jboss-eap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Docker for JBoss EAP Developers

Environment

Lab machine

  1. RHEL 7.1

  2. Vagrant 1.7.2

  3. virt-manager

  4. Red Hat CDK (Container Development Kit)

    1. RHEL Atomic Host 7.1 (with minor mods)

      1. Docker (preinstalled)

      2. Kubernetes (preinstalled)

      3. Pre-configured to use instructor machine registry

  5. Checkout of lab git repo

Instructor machine

As lab machine, but . Registry up and running inside Vagrant (see registry/)

Setup (if BYO)

Summary

For Instructors

  1. Set up registry inside Vagrant

  2. Stand up webserver to allow binaries to be downloaded (VirtualBox, Vagrant, RHEL Atomic Host, CDK)

  3. Share on network

For Attendees

  1. Install VirtualBox (Mac/Windows) or virt-manager (Linux)

  2. Install Vagrant

  3. Install CDK

  4. Run RHEL Atomic Host

Install Virtual Box or virt-manger

Install Vagrant

Install the Red Hat Container Development Kit

You need to have installed your virtualization environment and Vagrant.

First, download the CDK from the customer portal - https://access.redhat.com/downloads/content/293/ver=1/rhel---7/1.0.0/x86_64/product-downloads. You will need:

  1. Red Hat Container Tools

  2. Red Hat Atomic Vagrant box for VirtualBox or Red Hat Atomic Vagrant box for libvirt (choose based on your virtualization env)

Tip
If you are on Mac, the util/install-cdk-mac.sh script will set up the CDK for you. Place both the cdk zip file and the RHEL Atomic box in the downloads directory.

All of the remaining steps need to be performed using the command-line.

  1. Unzip the cdk.zip file you downloaded in your home directory. This should create ~/cdk (/Users/username/cdk)

$ cd
$ unzip ~/Downloads/cdk.zip

At this point, please view the included README files to familiarize yourself with the Red Hat Container Tools and to be notified if there are any changes since this install guide was published.

  1. Install additional Vagrant plugins for using Red Hat Vagrant boxes

To install additional Vagrant plugins to support Red Hat subscription management and Red Hat Enterprise Linux Atomic Host use ‘vagrant plugin install’ to install the .gem files that were including in CDK.zip. Please note: the version number of the .gem may have changed. You should use the file name that matches your downloaded files.

The installation of the first plugin make take several minutes Vagrant may install some additional gem files as needed.

$ cd ~/cdk/plugins
$ ls -1 \*.gem
$ vagrant plugin install vagrant-registration-0.0.8.gem
$ vagrant plugin install vagrant-atomic-0.0.3.gem

Verify the plugins are installed:

$ vagrant plugin list

Add the RHEL Server and Red Hat Atomic Host boxes to Vagrant.

These are the configured virtual machine images that you downloaded a previous step. You will be using these for container development and testing.

$ vagrant box add --name rhel-atomic-7 ~/Downloads/rhel-atomic-virtualbox-7.1-1.x86_64.box

Verify that the boxes got installed:

$ vagrant box list

The box image files will be stored in your home directory under ~/.vagrant.d. You will need adequate space there, approximately 2GB.

  1. Start up the RHEL standalone CDK Vagrant Box

$ cd ~/cdk/components/rhel/rhel-standalone
$ vagrant up

At this point, if all is going well, you will be asked for a username and password for Red Hat subscription management in order to register the system and enable downloading from Red Hat repositories. Enter the username and password you use with the Red Hat Customer Portal.

==> default: Registering box with vagrant-registration…
default: Would you like to register the system now (default: yes)? [y|n] y
default: Subscriber username: <username>
default: Subscriber password:

You can check whether your Vagrant box is running with vagrant status. Note: you must be in same the directory where your Vagrant file is located.

$ vagrant status

Now you can ssh into your Red Hat Enterprise Linux CDK Vagrant box:

$ vagrant ssh

When you are done, exit the ssh session. To stop the Vagrant box:

$ vagrant halt

To view the status of all Vagrant boxes on your system and verify that your box was properly stopped, use vagrant global-status:

$ vagrant global-status

If, at some point you want to delete the created VM and free up the KVM/libvirt resources, use vagrant destroy. Your Vagrantfile, and the box image in ~/.vagrant.d will remain allowing you to recreate a fresh version of the environment with a subsequent vagrant up.

$ vagrant destroy

Note: Do not delete the subdirectory .vagrant where Vagrant keeps per-machine state, without first using vagrant destroy to free up KVM/libvirt resources. If you no longer have the .vagrant subdirectory, you will need to use libvirt tools such as virt-manager (GUI) or virsh (command-line) to manually delete the resources that were created by Vagrant before you can bring a Vagrant box up with the same name.

After a vagrant destroy, you will be able to bring the Vagrant box up again in it’s original clean state.

You now have the Red Hat CDK software components successfully installed and can begin exploring container development.

Run the private registry and populate

Having installed your virtualization environment, Vagrant and the CDK, setting up the registry is easy. The registry is packaged as a Vagrant box, which in turn runs the registry and UI inside Docker containers ochestrated using Kubernetes. Docker and Kubernetes are brought up automatically by systemd. The box exxposes the registry on localhost:5000 and the registry UI on locahost:5001.

  1. Change to the registry directory cd registry.

  2. Bring up the vagrant box vagrant up.

  3. SSH in to the vagrant box vagrant ssh.

  4. Wait for the registry to come up. This can take a while, as Docker needs to fetch the registry and registry-ui containers from the ce-registry. To check the status, run kubectl get pods - once the registry is up you will see the status change to Running.

  5. Visit http://localhost:5001 and check that the repository UI is available. There are no images in the registry at the moment!

  6. Inside the vagrant box run /mnt/vagrant/push_images.sh. This will pull the necessary images for the lab from the ce-registry and push them to our local registry. This will take a while!

  7. Visit http://localhost:5001 and verify the images are now in the repository.

Deploy an application from JBoss Developer Studio

References

  1. Docker EAP Images Registry

  2. Ticket Monster

About

Docker JBoss EAP Tutorial

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published