Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

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

Learn how our document data model can map directly to how you program your app, and native database features like secondary indexes, geospatial and text search give you full access to your data. Brought to you in partnership with MongoDB.

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


Discover when your data grows or your application performance demands increase, MongoDB Atlas allows you to scale out your deployment with an automated sharding process that ensures zero application downtime. Brought to you in partnership with MongoDB.

Topics:
bluemix ,docker ,eclipse ,cloud

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

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

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

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}