@@ -6,28 +6,69 @@ metadata:
6
6
description : Template to produce a light weight imagestream and buildconfig for a multistage build
7
7
name : multistage-build-template
8
8
objects :
9
+ # #############################################################################
10
+ # the INPUT ImageStream (from phase 2)
11
+ - apiVersion : image.openshift.io/v1
12
+ kind : ImageStream
13
+ metadata :
14
+ name : intermediate
15
+ spec :
16
+ lookupPolicy :
17
+ local : true
18
+ tags :
19
+ - from :
20
+ kind : DockerImage
21
+ name : quay.io/jdowland/jlink:ubi9-jlinked-image
22
+ name : latest
23
+ referencePolicy :
24
+ type : Local
25
+ # #############################################################################
26
+ # the OUTPUT ImageStream
9
27
- apiVersion : image.openshift.io/v1
10
28
kind : ImageStream
11
29
metadata :
12
30
name : lightweight-image
13
31
spec :
14
32
lookupPolicy :
15
33
local : false
34
+ # #############################################################################
16
35
- apiVersion : build.openshift.io/v1
17
36
kind : BuildConfig
18
37
metadata :
19
38
name : multistage-buildconfig
20
39
spec :
21
40
source :
22
- type : Git
23
- git :
24
- uri : https://github.com/jhuttana/openjdk.git
25
- ref : phase-4
26
- contextDir : templates/jlink/
41
+ images :
42
+ - from :
43
+ kind : ImageStreamTag
44
+ name : intermediate:latest
45
+ paths :
46
+ # path does not exist in intermediate image, yet
47
+ # - sourcePath: /mnt/jrootfs
48
+ # destinationDir: jrootfs
49
+ - sourcePath : /deployments
50
+ destinationDir : deployments
51
+ - sourcePath : /tmp/jre/.
52
+ destinationDir : customJVM
53
+ - sourcePath : /opt/jboss/container/.
54
+ destinationDir : runScripts
55
+ type : Dockerfile
56
+ dockerfile : |
57
+ FROM registry.access.redhat.com/ubi9/ubi-micro
58
+ ARG JAVA_HOME=/usr/lib/jvm/java
59
+
60
+ #COPY jrootfs/ /
61
+ COPY deployments /
62
+ COPY customJVM ${JAVA_HOME}
63
+ COPY runScripts /opt/jboss/container/
64
+ # these are in the micro image
65
+ RUN rm -rf /var/lib/dnf /var/lib/rpm
66
+
67
+ ENV JAVA_HOME="${JAVA_HOME}" PATH="${JAVA_HOME}/bin:$PATH"
68
+ USER 185
69
+ CMD /opt/jboss/container/java/run/run-java.sh
27
70
strategy :
28
71
type : Docker
29
- dockerStrategy :
30
- dockerfilePath : Dockerfile
31
72
output :
32
73
to :
33
74
kind : ImageStreamTag
0 commit comments