@@ -49,6 +49,14 @@ native-image --replay .../path/to/alaunch.nirb.jar
49
49
this will rebuild the ` alaunch ` image with the same image arguments, environment variables, system properties
50
50
settings, classpath and module-path options as in the initial build.
51
51
52
+ To support the use-case of image-building-as-a-service, there should also be a way to create a bundle without
53
+ performing the initial build locally. This allows users to offload image building to a cloud-service specialized in
54
+ image building and retaining of replay bundles. The command line for that should be:
55
+
56
+ ``` shell
57
+ native-image --replay-prepare ...other native-image arguments...
58
+ ```
59
+
52
60
## Replay Bundles File Format
53
61
54
62
A ` <imagename>.nirb.jar ` file is a regular jar-file that contains all information needed to replay a previous build.
@@ -79,11 +87,19 @@ alaunch.nirb.jar
79
87
│ ├── all.env <- All environment variables used in the image build
80
88
│ ├── all.properties <- All system properties passed to the builder
81
89
│ ├── build.cmd <- Full native-image command line (minus --replay-create option)
82
- │ └── run.cmd <- Arguments to run application on java (for laucher, see below)
90
+ │ ├── run.cmd <- Arguments to run application on java (for laucher, see below)
91
+ │ └── container <- For containerized build this subdirs holds all info about that
92
+ │ ├── Dockerfile <- Container image that was used to perform the build
93
+ │ ├── run.cmd <- Arguments passed to docker/podman to run the container
94
+ │ └── setup.json <- Info about the docker/podman setup that was used
95
+ │ * Linux kernel version
96
+ │ * Docker/podman version
97
+ │ * CGroup v2 or CGroup v1
83
98
├── META-INF
84
99
│ ├── MANIFEST.MF <- Specifes rbundle/Launcher as mainclass
85
100
│ └── RBUNDLE.MF <- Contains replay bundle version info:
86
101
│ * Replay-bundle format version
102
+ │ * Platform the bundle was created on (e.g. linux-amd64)
87
103
│ * GraalVM / Native-image version used for build
88
104
├── out
89
105
│ ├── alaunch.debug <- Native debuginfo for the built image
@@ -106,6 +122,8 @@ Here we also find `RBUNDLE.MF`. This file is specific to replay bundles. Its exi
106
122
ordinary jar-file but a native image replay bundle. The file contains version information of the native image replay
107
123
bundle format itself and also which GraalVM version was used to create the bundle. This can later be used to report a
108
124
warning message if a bundle gets replayed with a GraalVM version different from the one used to create the bundle.
125
+ This file also contains information about the platform the bundle was created on (e.g. ` linux-amd64 ` or
126
+ ` darwin-aarch64 ` ).
109
127
110
128
### ` input ` :
111
129
@@ -125,6 +143,15 @@ class/module-path entries as the initial build. The use of `run.cmd` is explaine
125
143
File ` all.env ` contains the environment variables that we allowed the builder to see during the initial build and
126
144
` all.properties ` the respective system-properties.
127
145
146
+ #### ` input/stage/container ` :
147
+
148
+ If the image builder runs in a container environment, this subdirectory holds all information necessary to redo the
149
+ image build later in an equivalent container environment. It contains the ` Dockerfile ` that was used to specify the
150
+ container image that executed the image builder. Next, ` run.cmd ` contains all the arguments that were passed to
151
+ docker/podman. It does not contain the arguments passed to be builder. In ` setup.json ` we save all information about
152
+ the container environment that was used (Linux kernel version, CGroup V1 or V2, Docker/podman version). For more info
153
+ see [ below] ( #containerized-image-building-on-supported-platforms ) .
154
+
128
155
### ` build ` :
129
156
130
157
This folder is used to document the build process that lead to the image that was created alongside the bundle.
@@ -162,7 +189,8 @@ us to prevent the builder from using the network during image build**, thus guar
162
189
not depend on some unknown (and therefore unreproducible) network state. Another advantage is that we can mount
163
190
` input/classes ` and ` $GRAALVM_HOME ` read-only into the container and only allow read-write access to the mounted ` out `
164
191
and ` build ` directories. This will prevent the application code that runs at image build time to mess with anything
165
- other than those directories.
192
+ other than those directories. All information about containerized building is recorded in bundle subdirectory
193
+ ` input/stage/container ` .
166
194
167
195
### Fallback for systems without container support
168
196
0 commit comments