heidloff.net - Building is my Passion
Post
Cancel

Docker Tooling in Eclipse to build Liberty based Images for Bluemix

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 “/”.

image

image

There is also a servlet on the path “Servlet”.

image

image

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

image

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

image

The Maven install can be triggered from the Eclipse IDE.

image

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

image

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

image

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

image

To find out the URL to invoke your deployed app on Docker open the ports section. The 0.0.0.0 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”.

image

Featured Blog Posts
Disclaimer
The postings on this site are my own and don’t necessarily represent IBM’s positions, strategies or opinions.
Trending Tags