-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OPENJDK-2735] Jlink Stage 3 template #471
Conversation
Signed-off-by: Jayashree Huttanagoudar <[email protected]>
Signed-off-by: Jayashree Huttanagoudar <[email protected]>
Nice! This works because the multi-stage build is not split between two buildConfigs, so the You've moved to an external Dockerfile, but that is not what has made this work: this example commit brings the Dockerfile back into the template and removes the external git reference: jmtd@5cfd7d5 ; this performs the same. I think it is preferable to have the Dockerfile in-line in the template, because then the template is self-contained, and does not rely on fetching an external git repository during the build (and avoids issues of keeping that in sync etc) The next step is to remove the hard-coded
and then edit/simplify the result to add into the template. In particular, I think we should try changing
In other words I think creating the above ImageStream and changing the Dockerfile to have |
There might be another approach we can take here if we take a step back. The multistage docker build was a solution to a problem we had: wanting to copy a bunch of artefacts from one image into another. There are other ways to achieve that in OpenShift, see e.g. https://docs.openshift.com/container-platform/4.15/cicd/builds/creating-build-inputs.html If we temporarily ignore the first stage of the multi-stage build (which installs grep and gawk), and focus on the second part: we have the
|
copying the artefacts using the buildConfig (instead of multi-stage build) looks really promising. This is what I managed so far: I also created a Deployment from the
but this at least confirms that the run script was successfully copied in; as was java:
To resolve the missing We will also need the relevant triggers and probably wrapping ubi-micro up in an ImageStream. |
Thanks Jom for making these changes and getting it to this stage.
+1 |
Signed-off-by: Jayashree Huttanagoudar <[email protected]>
I also tried to create a deployment but its failing with
Am I doing anything wrong while creating the deployment ? |
Signed-off-by: Jayashree Huttanagoudar <[email protected]>
FROM registry.access.redhat.com/ubi9/ubi-micro | ||
ARG JAVA_HOME=/usr/lib/jvm/java | ||
|
||
COPY jrootfs/ / |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is putting the result at /jrootfs in the final image. We need to adjust it somehow so it unpacks over / instead.
Signed-off-by: Jayashree Huttanagoudar <[email protected]>
Signed-off-by: Jayashree Huttanagoudar <[email protected]>
As the
COPY --from=ubi9-jlinked-image
are not working fine directly in the template (PR #461) I just tried this approach to get our phase-3 done.This is working fine.