You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e0bdeea
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: jib-gradle-plugin/README.md
+26-16Lines changed: 26 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,10 +143,7 @@ Field | Type | Default | Description
143
143
--- | --- | --- | ---
144
144
`from` | [`from`](#from-closure) | See [`from`](#from-closure) | Configures the base image to build your application on top of.
145
145
`to` | [`to`](#to-closure) | *Required* | Configures the target image to build your application to.
146
-
`jvmFlags` | `List<String>` | *None* | Additional flags to pass into the JVM when running your application.
147
-
`mainClass` | `String` | *Inferred\** | The main class to launch your application from.
148
-
`args` | `List<String>` | *None* | Default main method arguments to run your application with.
149
-
`format` | `String` | `Docker` | Use `OCI` to build an [OCI container image](https://www.opencontainers.org/).
146
+
`container` | [`container`](#container-closure) | See [`container`](#container-closure) | Configures the container that is run from your built image.
150
147
`useProjectOnlyCache` | `boolean` | `false` | If set to true, Jib does not share a cache between different Maven projects.
151
148
152
149
*\* Uses the main class defined in the `jar` task or tries to find a valid main class.*
@@ -174,14 +171,24 @@ Property | Type
174
171
`username` | `String`
175
172
`password` | `String`
176
173
174
+
<aname="container-closure"></a>`container` is a closure with the following properties:
175
+
176
+
Property | Type | Default | Description
177
+
--- | --- | --- | ---
178
+
`jvmFlags` | `List<String>` | *None* | Additional flags to pass into the JVM when running your application.
179
+
`mainClass` | `String` | *Inferred\** | The main class to launch your application from.
180
+
`args` | `List<String>` | *None* | Default main method arguments to run your application with.
181
+
`ports` | `List<String>` | *None* | Ports that the container exposes at runtime (similar to Docker's [EXPOSE](https://docs.docker.com/engine/reference/builder/#expose) instruction).
182
+
`format` | `String` | `Docker` | Use `OCI` to build an [OCI container image](https://www.opencontainers.org/).
183
+
177
184
### Example
178
185
179
-
In this configuration, the image is:
180
-
*Built from a base of `openjdk:alpine` (pulled from Docker Hub)
181
-
*Pushed to `localhost:5000/my-image:built-with-jib`
186
+
In this configuration, the image:
187
+
*Is built from a base of `openjdk:alpine` (pulled from Docker Hub)
188
+
*Is pushed to `localhost:5000/my-image:built-with-jib`
182
189
* Runs by calling `java -Xms512m -Xdebug -Xmy:flag=jib-rules -cp app/libs/*:app/resources:app/classes mypackage.MyApp some args`
183
-
*Reproducible
184
-
*Built as OCI format
190
+
*Exposes port 1000 for tcp (default), and ports 2000, 2001, 2002, and 2003 for udp
@@ -258,7 +268,7 @@ These credentials can be stored in `gradle.properties`, retrieved from a command
258
268
259
269
For example, you can use a key file for authentication (for GCR, see [Using a JSON key file](https://cloud.google.com/container-registry/docs/advanced-authentication#using_a_json_key_file)):
`image` | string | *Required* | The image reference for the target image. This can also be specified via the `-Dimage` command line option.
207
204
`credHelper` | string | *None* | Suffix for the credential helper that can authenticate pulling the base image (following `docker-credential-`).
208
205
206
+
<aname="container-object"></a>`container` is an object with the following properties:
207
+
208
+
Property | Type | Default | Description
209
+
--- | --- | --- | ---
210
+
`jvmFlags` | list | *None* | Additional flags to pass into the JVM when running your application.
211
+
`mainClass` | string | *Inferred\** | The main class to launch the application from.
212
+
`args` | list | *None* | Default main method arguments to run your application with.
213
+
`ports` | `List<String>` | *None* | Ports that the container exposes at runtime (similar to Docker's [EXPOSE](https://docs.docker.com/engine/reference/builder/#expose) instruction).
214
+
`format` | string | `Docker` | Use `OCI` to build an [OCI container image](https://www.opencontainers.org/).
215
+
209
216
### Example
210
217
211
-
In this configuration, the image is:
212
-
*Built from a base of `openjdk:alpine` (pulled from Docker Hub)
213
-
*Pushed to `localhost:5000/my-image:built-with-jib`
218
+
In this configuration, the image:
219
+
*Is built from a base of `openjdk:alpine` (pulled from Docker Hub)
220
+
*Is pushed to `localhost:5000/my-image:built-with-jib`
214
221
* Runs by calling `java -Xms512m -Xdebug -Xmy:flag=jib-rules -cp app/libs/*:app/resources:app/classes mypackage.MyApp some args`
215
-
*Reproducible
216
-
*Built as OCI format
222
+
*Exposes port 1000 for tcp (default), and ports 2000, 2001, 2002, and 2003 for udp
223
+
*Is built as OCI format
217
224
218
225
```xml
219
226
<configuration>
@@ -224,17 +231,23 @@ In this configuration, the image is:
0 commit comments