carlossg / docker-maven

Official Docker image with Maven
Apache License 2.0
515 stars 422 forks source link

$JAVA_HOME is missing on amazoncorretto-8-debian #452

Closed flesser closed 3 months ago

flesser commented 3 months ago

The environment variable JAVA_HOME is missing on the amazoncorretto-8-debian:

docker run --rm -it maven:3.9.6-amazoncorretto-8-debian bash -c 'echo $JAVA_HOME'
# no output

In contrast, it is present in the Amazon Linux version:

docker run --rm -it maven:3.9.6-amazoncorretto-8 bash -c 'echo $JAVA_HOME'
/usr/lib/jvm/java-1.8.0-amazon-corretto

I guess it's because https://github.com/carlossg/docker-maven/blob/main/amazoncorretto-8/Dockerfile inherits this env var FROM amazoncorretto:8 while https://github.com/carlossg/docker-maven/blob/main/amazoncorretto-8-debian/Dockerfile installs a *.deb into a plain debian:slim which does not seem to export this variable permanently.

I did not check if other Versions (Java >8) have the same issue, but probably.

carlossg commented 3 months ago

FYI @anirbanmu

anirbanmu commented 3 months ago

Thanks for the heads up @carlossg, I hope try to add it soon.