August 2017
Intermediate to advanced
332 pages
9h 16m
English
Let's create Dockerfile in the root directory of the calculator project:
FROM frolvlad/alpine-oraclejdk8:slimCOPY build/libs/calculator-0.0.1-SNAPSHOT.jar app.jarENTRYPOINT ["java", "-jar", "app.jar"]
Dockerfile uses a base image that contains JDK 8 (frolvlad/alpine-oraclejdk8:slim). It also copies the application JAR (created by Gradle) and runs it. Let's check if the application builds and runs:
$ ./gradlew build$ docker build -t calculator .$ docker run -p 8080:8080 --name calculator ...
Read now
Unlock full access