Public | Automated Build

Last pushed: 4 days ago
Short Description
Java 8 (1.8.0_162) JDK + Maven 3.5.0 + Python 2.7.12
Full Description

Java 8 (1.8.0_172) JDK + Maven 3.5.3 + Python 2.7.12


  • java version "1.8.0_172"
    Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
    Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
  • Apache Maven 3.5.3
    Maven home: /usr/apache-maven-3.5.3
  • Python 2.7.12
  • Other tools: git wget unzip vim python python-setuptools python-dev python-numpy

Pull the image from Docker Repository

docker pull openkbs/jre-mvn-py

Base the image to build add-on components

FROM openkbs/jre-mvn-py

Run the image

Then, you're ready to run :
Make sure you create your work directory, e.g., /data

mkdir ./data
docker run -d --name my-jre-mvn-py -v $PWD/data:/data -i -t openkbs/jre-mvn-py

Build and Run your own image

Say, you will build the image "my/jre-mvn-py".

docker build -t my/jre-mvn-py .

To run your own image, say, with some-jre-mvn-py:

mkdir ./data
docker run -d --name some-jre-mvn-py -v $PWD/data:/data -i -t my/jre-mvn-py

Shell into the Docker instance

docker exec -it some-jre-mvn-py /bin/bash

Run Python code

To run Python code

docker run --rm openkbs/jre-mvn-py python -c 'print("Hello World")'


docker run -i --rm openkbs/jre-mvn-py python < 


mkdir ./data
echo "print('Hello World')" > ./data/
docker run -it --rm --name some-jre-mvn-py -v "$PWD"/data:/data openkbs/jre-mvn-py python


alias dpy='docker run --rm openkbs/jre-mvn-py python'
dpy -c 'print("Hello World")'

Compile or Run java while no local installation needed

Remember, the default working directory, /data, inside the docker container -- treat is as "/".
So, if you create subdirectory, "./data/workspace", in the host machine and
the docker container will have it as "/data/workspace".

#!/bin/bash -x
mkdir ./data
cat >./data/ <<-EOF
public class HelloWorld {
   public static void main(String[] args) {
      System.out.println("Hello, World");
cat ./data/
alias djavac='docker run -it --rm --name some-jre-mvn-py3 -v '$PWD'/data:/data openkbs/jre-mvn-py3 javac'
alias djava='docker run -it --rm --name some-jre-mvn-py3 -v '$PWD'/data:/data openkbs/jre-mvn-py3 java'

djava HelloWorld

And, the output:

Hello, World

Hence, the alias above, "djavac" and "djava" is your docker-based "javac" and "java" commands and
it will work the same way as your local installed Java's "javac" and "java" commands.
However, for larger complex projects, you might want to consider to use Docker-based IDE.
For example, try this docker-scala-ide:
Scala IDE in Docker
See also,
Java Development in Docker

Docker Pull Command
Source Repository