Over a million developers have joined DZone.

Docker Tooling in Eclipse to Build Liberty Based Images for Bluemix

Docker Tooling from Eclipse is perfect for those who don't want to keep scripting commands from memory.

· Cloud Zone

Download the Essential Cloud Buyer’s Guide to learn important factors to consider before selecting a provider as well as buying criteria to help you make the best decision for your infrastructure needs, brought to you in partnership with Internap.

While some developers prefer command line tools, I often use graphical tools if available since I cannot memorize all the different commands. That's why I tried the relative new Docker Tooling for Eclipse. The plugin is relative new and there is certainly room for improvements but it helps with managing images and containers, e.g. running containers and creating images. Below is a simple sample how to use the tooling to create a Liberty based image with a hello world app that can be deployed to Bluemix.

Since the end of last year the Liberty profile is on Docker Hub. The Liberty Profile image is supplied for IBM Containers. You can use this image to build your application Java-based war files in a Liberty container.

The hello world sample contains one html file on the context root "/".

There is also a servlet on the path "Servlet".

The context root "/" is defined in ibm-web-ext.xml.

The sample uses Maven to build the project and create a war file.

The Maven install can be triggered from the Eclipse IDE.

The following Dockerfile is a very simple sample. Read the documentation for more options.

Via the Docker Tooling you can refer to the Dockerfile to create a new image.

Based on the image you can run containers. In the sample I used all defaults, e.g. the port mappings.

To find out the URL to invoke your deployed app on Docker open the ports section. The needs to be replaced with your Docker ip address. You can find it out via "boot2docker ip". Since I don't want to do this over and over I created an entry in my host file for "dockerhost". To run the sample app with the context root "/" simply invoke "http://dockerhost:yourport".

The Cloud Zone is brought to you in partnership with Internap. Read Bare-Metal Cloud 101 to learn about bare-metal cloud and how it has emerged as a way to complement virtualized services.


Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}