Over a million developers have joined DZone.

Docker Tooling in Eclipse to Build Liberty Based Images for Bluemix

DZone's Guide to

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 ·
Free Resource

Discover a centralized approach to monitor your virtual infrastructure, on-premise IT environment, and cloud infrastructure – all on a single platform.

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".

Learn how to auto-discover your containers and monitor their performance, capture Docker host and container metrics to allocate host resources, and provision containers.

bluemix ,docker ,eclipse ,cloud

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}