Public | Automated Build

Last pushed: 2 months ago
Short Description
Java 8 (1.8.0_162) JDK + Maven 3.5.0 + Python 3.5.2
Full Description

Java 8 (1.8.0_162) JDK + Maven 3.5.0 + Python 3.5.2


  • Java version "1.8.0_162"
    Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
    Java HotSpot(TM) 64-Bit Server VM (build 25.162-b12, mixed mode)
  • Apache Maven 3.5.0
  • Other tools: git wget unzip vim python python-setuptools python-dev python-numpy

Pull the image from Docker Repository

docker pull openkbs/jdk-mvn-py3

Base the image to build add-on components

FROM openkbs/jdk-mvn-py3

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-jdk-mvn-py3 -v $PWD/data:/data -i -t openkbs/jdk-mvn-py3

Build and Run your own image

Say, you will build the image "my/jdk-mvn-py3".

docker build -t my/jdk-mvn-py3 .

To run your own image, say, with some-jdk-mvn-py3:

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

Shell into the Docker instance

docker exec -it some-jdk-mvn-py3 /bin/bash

Run Python code

To run Python code

docker run -it --rm openkbs/jdk-mvn-py3 python3 -c 'print("Hello World")'


docker run -i --rm openkbs/jdk-mvn-py3 python3 < 


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


alias dpy3='docker run --rm openkbs/jdk-mvn-py3 python3'
dpy3 -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-jdk-mvn-py3 -v '$PWD'/data:/data openkbs/jdk-mvn-py3 javac'
alias djava='docker run -it --rm --name some-jdk-mvn-py3 -v '$PWD'/data:/data openkbs/jdk-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.

To run specialty Java/Scala IDE alternatives

However, for larger complex projects, you might want to consider to use Docker-based IDE.
For example, try the following docker-scala-ide:
Scala IDE in Docker
See also,
Java Development in Docker

Docker Pull Command
Source Repository