Dockerfile for the
Docker Hub image which contains Alpine based JRE 8 for running Java applications.
bash is also installed because most Java applications tend have a starting script.
- Based on
- Two mount points created at
/datawith the working directory set to
Assuming the Gradle Java starter project in the
working directory, one can build the executable by
docker run --rm -v $(pwd):/app jaysong/gradle:8-2.13 installDist
then run it by
docker run --rm -v $(pwd)/build/install/app:/app jaysong/jrunner:8-jre-alpine ./bin/app
To run web services that listens on certain ports, use
docker run -it --rm --expose 8080 -p 8080:8080 -v $(pwd)/tmp:/data -v $(pwd)/build/install/app:/app jaysong/jrunner:8-jre-alpine ./bin/app