Sign inSign up

fabioalvaro/debianwithoraclejdk8

By fabioalvaro

Updated over 8 years ago

An image from debian 9 stable plus with oracle jdk 8. Exclent to use in Java projects! the best

Image
0

10K+

fabioalvaro/debianwithoraclejdk8 repository overview

1) How to use with JDK and Debian Only


$ 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)  

2) How to use to run together a maven and springboot based java project

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

how to create the file then put the lines above and save it :

touch ~/run-container.sh && vim run-container.sh

Finally running the script to up the magic container

$ 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

using besides the aws configuration

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 

Tag summary

Content type

Image

Digest

Size

248.3 MB

Last updated

over 8 years ago

docker pull fabioalvaro/debianwithoraclejdk8