An image from debian 9 stable plus with oracle jdk 8. Exclent to use in Java projects! the best
10K+
$ docker pull fabioalvaro/debianwithoraclejdk8
$ docker run -it --name mycontainer -v "$HOME:/root" fabioalvaro/debianwithoraclejdk8:1.0.0
the default package of jdk is at /opt/java
try with java -version on terminal
$ java -version
$ java version "1.8.0_171"
$ Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
$ Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
create a file inside you home folder run-container.sh with the lines bellow: #begin of file clear echo "[X] Parando os containers.........." echo "=================================================================" docker stop -t 0 $(docker ps -q) docker stop -t 0 container-debianwithoraclejdk8 echo " " echo "[X] Apagando container.........." echo " " docker rm container-debianwithoraclejdk8 echo "[X] Creating Container from this beatifull image.........." echo " " BASEPROJETO=/home/somefolder/anyjavafolder docker run -it --name container-debianwithoraclejdk8 -p 5000:5000 -v "$BASEPROJETO:/opt/projeto" -v"$HOME/.m2:/root/.m2" fabioalvaro/debianwithoraclejdk8:latest #end of file
touch ~/run-container.sh && vim run-container.sh
$ chmod +x ~/run-container.sh
$ ~/run-container.sh
# inside the container enter in folder and call maven commando to compile the spring project
123123123#$ cd /opt/projeto
123123123#$ mvn spring-boot:run
Optionally you can use the aws credentials to access some environment at the amazon environment. So to use the credentials of the host to modify the script as bellow:
# Add the mapping volume to your aws credential file of aws cli on the host.
docker run -it --name container-debianwithoraclejdk8 -p 5000:5000 -v "$BASEPROJETO:/opt/projeto" -v"$HOME/.m2:/root/.m2" -v"$HOME/.aws:/root/.aws" fabioalvaro/debianwithoraclejdk8:latest
Content type
Image
Digest
Size
248.3 MB
Last updated
over 8 years ago
docker pull fabioalvaro/debianwithoraclejdk8