Docker Java 8 Helloworld

Example Docker image that when echos “Hello world!” when run.

Source: https://github.com/stevenalexander/docker-java8-helloworld

terminal gif

Image has JRE rather than JDK to limit installed components. Tested on Mac using Boot2Docker(v1.5.0).

Requires:

To run:

# compile class
javac helloworld.java

# build image
docker build -t java8-helloworld .

# run image
docker run -it --rm --name my-running-app java8-helloworld
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s