This is an automated email from the ASF dual-hosted git repository.

abstractdog pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tez.git


The following commit(s) were added to refs/heads/master by this push:
     new 86b11997b TEZ-4496: Tez precommit fails while building yetus image - 
no alternatives for some executables (#289)
86b11997b is described below

commit 86b11997b43b11a9699ce3817e8a6838f790b002
Author: Bodor Laszlo <bodorlaszlo0...@gmail.com>
AuthorDate: Mon Jun 12 15:38:12 2023 +0200

    TEZ-4496: Tez precommit fails while building yetus image - no alternatives 
for some executables (#289)
---
 build-tools/docker/Dockerfile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/build-tools/docker/Dockerfile b/build-tools/docker/Dockerfile
index 3c0f1c127..5b681067a 100644
--- a/build-tools/docker/Dockerfile
+++ b/build-tools/docker/Dockerfile
@@ -181,8 +181,11 @@ RUN apt-get -q update && apt-get -q install 
--no-install-recommends -y openjdk-8
 RUN apt-get -q update && apt-get -q install --no-install-recommends -y 
default-jre-headless openjdk-11-jdk-headless \
     && apt-get clean \
     && rm -rf /var/lib/apt/lists/* \
-    && update-java-alternatives -s java-1.8.0-openjdk-amd64 \
-    && rm -f /usr/lib/jvm/default-java \
+    && update-java-alternatives -s java-1.8.0-openjdk-amd64 || :
+# since update alternatives might fail on executables that we don't really 
need (e.g. appletviewer)
+# and return with exit code <0 (actually: 2), we can simply do a sanity check 
if the version is
+# as expected for "java" executable after the update and go on
+RUN java -version 2>&1 | grep "1.8.0" && rm -f /usr/lib/jvm/default-java \
     && ln -s java-8-openjdk-amd64 /usr/lib/jvm/default-java
 ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
 

Reply via email to