Skip to content

Develop Liberty applications on Docker Containers in Bluemix with Eclipse

Notifications You must be signed in to change notification settings

rvennam/LibertyIBMContainers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Developing Liberty applications on IBM Containers

This guide will help you:

  1. Run a WebSphere Liberty Docker container on Bluemix with remote administration enabled.

  2. Connect Eclipse to the Liberty container

  3. Start developing in Eclipse and watch your container instantly pick up changes.

Run Liberty image on IBM Containers

git clone <THIS REPO URL>
cd LibertyIBMContainers

# If you want to change the username and password for remote admin (recommended), you can edit remote.xml

# Prereq: Install cf, cf ic extension and log in to cf.
# Build docker image on IBM Containers using the Dockerfile in this folder.
cf ic build -t rliberty .

# Identify the image created and note the name
cf ic images

# Run the container
# Replace "registry.ng.bluemix.net/rvennamdocker/rliberty" with your own image name.
cf ic run --name rserver -p 9080:9080 -p 9443:9443 -d -t registry.ng.bluemix.net/rvennamdocker/rliberty

# Acquire a Public IP. Note this IP for later
cf ic ip request

# Bind that IP address to the container
cf ic ip bind <public_IP_address> rserver

Create server definition in Eclipse WDT

Confirm that you have a recent version of Eclipse with the WDT plugin.

  1. Set up a local Liberty server as outlined here: https://developer.ibm.com/wasdev/downloads/liberty-profile-using-eclipse/

  2. Now, we'll create a remote Liberty server. alt tag

In the Servers view of Eclipse, right-click to create a new Liberty server. Select Liberty and fill the hostname with the Public IP of your Bluemix Container that you noted above.

alt tag

Fill in the credentials. The default User is adminUser, Password is adminPassword and the Port 9443. These were defined in the server configuration in the previous section.

  1. Click Verify and Finish!

alt tag

Your Eclipse workspace should now be connected to your Liberty docker container on Bluemix.

You're ready to start deploying applications to this Server. As you update your code, Eclipse will instantly push changes to your container.

Create a Hello World app

  1. In Eclipse File -> New -> Dynamic Web Project. Enter HelloWorld for the name and uncheck 'Add Project to an EAR'

  2. Open the project and create a new file called 'index.html' under WebContent folder

  3. Add some html to this file <html><h2>Hello World!</h2></html> and Save

alt tag

  1. Right click on your remote server -> Add and Remote, and deploy the HelloWorld project.

You should be able to access your application by going to http://<PUBLIC_IP>:9080/HelloWorld

  1. Start making more changes to index.html and watch your application update.

Happy coding!

About

Develop Liberty applications on Docker Containers in Bluemix with Eclipse

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published