-
Notifications
You must be signed in to change notification settings - Fork 44
Docker with Java
Somkiat Puisungnoen edited this page Nov 2, 2017
·
2 revisions
public class Hello {
public static void main(String... args) {
System.out.println("Hello World");
}
}
Compile java
docker container run --rm -v $(pwd):/somkiat/src \
-w /somkiat/src \
openjdk:8u131-jdk-alpine \
javac Hello.java
Run java
docker container run --rm -v $(pwd):/somkiat/src \
-w /somkiat/src \
openjdk:8u131-jdk-alpine \
java Hello