I'm seeing some behavior and I don't know if my expectations are wrong
or if something is amiss in how Yetus relaunches under docker.
I've got a project specific Dockerfile that's trying to use jdk7 from
Azul Systems.
In my Dockerfile, I install the jdk and attempt to make sure it's seen
as JAVA_HOME.
e.g. Assuming the needed repository has been set up:
RUN apt-get -q install --no-install-recommends -y zulu-7
RUN update-alternatives --config java
RUN update-alternatives --config javac
ENV JAVA_HOME=/usr/lib/jvm/zulu-7-amd64
ENV PATH="${JAVA_HOME}/bin:${PATH}"
If I use this Dockerfile as my project dockerfile for a yetus
test-patch run, I always get the message that Yetus has overridden the
JAVA_HOME to point at the openjdk JRE (which doesn't work for my
build). Looking at the code, this should only happen if JAVA_HOME
isn't defined.
If instead I generate an image from the Dockerfile and then tell
docker to run an interactive container to give me a shell, I can see
JAVA_HOME and PATH with what I expect. If I install Yetus in the
container via this same shell and run it in non-docker mode it
similarly picks up JAVA_HOME and uses it as I would expect.
Currently I'm working around the issue by passing in --java-home when
test-patch is executed, but I'd prefer to have things work via the
environment variable from the Dockerfile since it would ease
maintenance when I need to change things.
If this isn't clear enough, I believe I can put together a small
reproduction project.