Skip to content

Commit 2b3282f

Browse files
committed
TEZ-4496: Tez precommit fails while building yetus image - no alternatives for some executables
1 parent 6722ef3 commit 2b3282f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

build-tools/docker/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,11 @@ RUN apt-get -q update && apt-get -q install --no-install-recommends -y openjdk-8
181181
RUN apt-get -q update && apt-get -q install --no-install-recommends -y default-jre-headless openjdk-11-jdk-headless \
182182
&& apt-get clean \
183183
&& rm -rf /var/lib/apt/lists/* \
184-
&& update-java-alternatives -s java-1.8.0-openjdk-amd64 \
185-
&& rm -f /usr/lib/jvm/default-java \
184+
&& update-java-alternatives -s java-1.8.0-openjdk-amd64
185+
# since update alternatives might fail on executables that we don't really need (e.g. appletviewer)
186+
# and return with exit code <0 (actually: 2), we can simply do a sanity check if the version is
187+
# as expected for "java" executable after the update and go on
188+
RUN java -version 2>&1 | grep "1.8.0" && rm -f /usr/lib/jvm/default-java \
186189
&& ln -s java-8-openjdk-amd64 /usr/lib/jvm/default-java
187190
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
188191

0 commit comments

Comments
 (0)