Skip to content

Commit 6007bd4

Browse files
committed
Delete multistage docker build sources from templates/jlink/ and also templates/jlink/jlink-builder/
Signed-off-by: Jayashree Huttanagoudar <[email protected]>
1 parent df69487 commit 6007bd4

File tree

3 files changed

+38
-124
lines changed

3 files changed

+38
-124
lines changed

templates/jlink/Dockerfile

Lines changed: 0 additions & 30 deletions
This file was deleted.

templates/jlink/README.md

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,57 @@
22

33
Try it out:
44

5-
## Stage 1: build and analyse application with OpenShift source-to-image (S2I)
5+
## Stage 1: create ubi9 jlink imagestream and push a ubi9 image with jmods installed to it.
66

77
You need:
88

9-
1. Access to an OpenShift instance, or, use [the s2i standalone program](https://github.com/openshift/source-to-image)
10-
* _([you might need to use an old version](https://github.com/openshift/source-to-image/issues/1135))_
11-
2. The OpenJDK builder image (with the customisations from the `jlink-dev` branch).
12-
There's one at `quay.io/jdowland/jlink:latest`
13-
3. A quickstart ([there's a specially-prepared Quarkus quickstart](https://github.com/jmtd/quarkus-quickstarts/tree/OPENJDK-631-fastjar-layout);
14-
in the future [the mainline Quarkus quickstarts will be suitable](https://github.com/quarkusio/quarkus-quickstarts/pull/1359))
9+
1. Access to an OpenShift instance, such as crc
10+
2. UBI9 OpenJDK ImageStreams. You can load them from this repository with
1511

16-
Here's a recipe using local `s2i`
12+
oc create -f templates/ubi9-community-image-streams.json
1713

18-
```
19-
BASEIMG=quay.io/jdowland/jlink:latest
20-
APPSRC=https://github.com/jmtd/quarkus-quickstarts.git
21-
CONTEXTDIR=getting-started
22-
REV=OPENJDK-631-fastjar-layout
23-
OUTIMG=ubi9-jlinked-image
14+
Steps to produce the imagestream and image:
2415

25-
s2i build --pull-policy never --context-dir=${CONTEXTDIR} -r=${REV} \
26-
-e QUARKUS_PACKAGE_TYPE=uber-jar \
27-
-e S2I_ENABLE_JLINK=true \
28-
${APPSRC} \
29-
${BASEIMG} \
30-
${OUTIMG}
31-
```
16+
1. install the template
3217

33-
## Stage 2: multi-stage build to assemble micro runtime
18+
oc create -f templates/jlink/jlink-builder/jlink-builder-template.yaml
3419

35-
You need:
20+
This will create a Template called jlink-builder-template, you should see
21+
22+
template.template.openshift.io/jlink-builder-template created
23+
24+
and after running oc get template, it should be in the list as
25+
26+
jlink-builder-template Template to produce an imagestream and buildconfig for a Jlink builder image 1 (all set) 2
27+
28+
2. Set the parameters and create the imagestream and buildconfig from the template.
29+
30+
The template for now defines a single parameter, JDK_VERSION. Setting this will set the version of the builder image used in the BuildConfig. Currently suppoted values are 11, 17, and 21. By default this will be 11.
31+
32+
oc process --parameters jlink-builder-template
33+
34+
NAME DESCRIPTION GENERATOR VALUE
35+
JDK_VERSION JDK version to produce a jmods image for 11
36+
37+
In order to set the JDK version, you will need to use the -p flag of oc process. To process the template and create the imagestreams, simply run
3638

37-
1. The output image from the first stage
38-
* _here's one we made earlier: `quay.io/jdowland/jlink:quarkus-getting-started`_
39-
2. OpenShift, or a container runtime (e.g. Docker)
40-
3. [this Dockerfile](Dockerfile) (In future this is an OpenShift template)
39+
oc process jlink-builder-template -p JDK_VERSION=11 | oc create -f -
40+
41+
imagestream.image.openshift.io/ubi9-openjdk-11-jlink created
42+
buildconfig.build.openshift.io/jlink-builder-jdk-11 created
4143

42-
With docker, from a clone of this repository, in this directory:
44+
3. Start and observe the build
4345

44-
```
45-
docker build -t myapp -f .
46-
```
46+
Start the build using
4747

48-
## Stage 3: try it out!
48+
oc start-build jlink-builder-jdk-11
49+
50+
build.build.openshift.io/jlink-builder-jdk-11-1 started
4951

50-
Does it work?
52+
Then observe it by using
5153

52-
docker run --rm -ti -p 8080 myapp
54+
oc logs -f bc/jlink-builder-jdk-11
5355

54-
How big is it?
56+
## Stage 2: build and analyse application with OpenShift source-to-image (S2I)
5557

56-
docker inspect -f '{{.Size}}' myapp
58+
TODO

templates/jlink/jlink-builder/README.md

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)