-
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5576f04
Make suitable modifications to Dockerfile for 3-phase build template
jhuttana 22bda43
Add buildConfig to get a template for multistage-build
jhuttana fa066b7
Pull in the further changes
jhuttana 39c2f5e
Uncomment jrootfs lines and undo the changes to Dockerfile
jhuttana 904e4b9
Copy only the contents of jrootfs
jhuttana 061dd82
Add imageStream needed for ubi-micro [OPENJDK-2896]
jhuttana File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
apiVersion: template.openshift.io/v1 | ||
kind: Template | ||
metadata: | ||
annotations: | ||
description: Template to produce a light weight imagestream and buildconfig for a multistage build | ||
name: multistage-build-template | ||
objects: | ||
############################################################################## | ||
# the INPUT ImageStream (from phase 2) | ||
- apiVersion: image.openshift.io/v1 | ||
kind: ImageStream | ||
metadata: | ||
name: intermediate | ||
spec: | ||
lookupPolicy: | ||
local: true | ||
tags: | ||
- from: | ||
kind: DockerImage | ||
name: quay.io/jdowland/jlink:ubi9-jlinked-image | ||
name: latest | ||
referencePolicy: | ||
type: Local | ||
############################################################################## | ||
# the OUTPUT ImageStream | ||
- apiVersion: image.openshift.io/v1 | ||
kind: ImageStream | ||
metadata: | ||
name: lightweight-image | ||
spec: | ||
lookupPolicy: | ||
local: false | ||
############################################################################## | ||
- apiVersion: build.openshift.io/v1 | ||
kind: BuildConfig | ||
metadata: | ||
name: multistage-buildconfig | ||
spec: | ||
source: | ||
images: | ||
- from: | ||
kind: ImageStreamTag | ||
name: intermediate:latest | ||
paths: | ||
- sourcePath: /mnt/jrootfs | ||
destinationDir: jrootfs | ||
- sourcePath: /deployments | ||
destinationDir: deployments | ||
- sourcePath: /tmp/jre/. | ||
destinationDir: customJVM | ||
- sourcePath: /opt/jboss/container/. | ||
destinationDir: runScripts | ||
type: Dockerfile | ||
dockerfile: | | ||
FROM registry.access.redhat.com/ubi9/ubi-micro | ||
ARG JAVA_HOME=/usr/lib/jvm/java | ||
|
||
COPY jrootfs/ / | ||
COPY deployments / | ||
COPY customJVM ${JAVA_HOME} | ||
COPY runScripts /opt/jboss/container/ | ||
# these are in the micro image | ||
RUN rm -rf /var/lib/dnf /var/lib/rpm | ||
|
||
ENV JAVA_HOME="${JAVA_HOME}" PATH="${JAVA_HOME}/bin:$PATH" | ||
USER 185 | ||
CMD /opt/jboss/container/java/run/run-java.sh | ||
strategy: | ||
type: Docker | ||
output: | ||
to: | ||
kind: ImageStreamTag | ||
name: lightweight-image:latest # Tag for the final output image | ||
triggers: | ||
- type: ConfigChange |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.