dongjoon-hyun commented on a change in pull request #35176:
URL: https://github.com/apache/spark/pull/35176#discussion_r782916795



##########
File path: 
resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh
##########
@@ -36,6 +36,10 @@ if [ -z "$uidentry" ] ; then
     fi
 fi
 
+if [ -z "$JAVA_HOME" ]; then
+  JAVA_HOME=$(java -XshowSettings:properties -version 2>&1 > /dev/null | grep 
'java.home' | awk '{print $3}')

Review comment:
       @Yikun . 
   
   Previously `entrypoint.sh` assumes that `JAVA_HOME` exists. And, `openjdk 
8/11` images already have `JAVA_HOME`. So, those images will use the existing 
one and this PR skips them via `-z $"JAVA_HOME"`.
   ```
   $ docker run -it --rm openjdk:8
   root@a63a89b131b3:/# echo $JAVA_HOME
   /usr/local/openjdk-8
   ```
   
   Second, this file is shared in Java8/11/17. I don't think your suggestion 
works on Java8/11. If you try to use it in `ENV` command, it also doesn't work.
   > Maybe we could just use /usr/lib/jvm/java-17-openjdk-$(dpkg 
--print-architecture)/ or asign dpkg --print-architecture to ARCH in dockerfile.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to