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 29caf63
Browse filesBrowse the repository at this point in the historyBrowse files
Subsequent builds are much faster than the initial build.
81
90
82
-
If you want to clear Jib's build cache and force it to re-pull the base image and re-build the application layers, run:
91
+
*Having trouble? Let us know by [submitting an issue](/../../issues/new), contacting us on [Gitter](https://gitter.im/google/jib), or posting to the [Jib users forum](https://groups.google.com/forum/#!forum/jib-users).*
92
+
93
+
#### Build to Docker daemon
94
+
95
+
Jib can also build your image directly to a Docker daemon. This uses the `docker` command line tool and requires that you have `docker` available on your `PATH`.
83
96
84
97
```shell
85
-
gradle clean build jib
98
+
gradle jibDockerBuild
86
99
```
87
100
88
-
*Having trouble? Let us know by [submitting an issue](/../../issues/new), contacting us on [Gitter](https://gitter.im/google/jib), or posting to the [Jib users forum](https://groups.google.com/forum/#!forum/jib-users).*
101
+
If you are using [`minikube`](https://github.com/kubernetes/minikube)'s remote Docker daemon, make sure you [set up the correct environment variables](https://github.com/kubernetes/minikube/blob/master/docs/reusing_the_docker_daemon.md) to point to the remote daemon:
102
+
103
+
```shell
104
+
eval$(minikube docker-env)
105
+
gradle jibDockerBuild
106
+
```
89
107
90
108
### Run `jib` with each build
91
109
92
110
You can also have `jib` run with each build by attaching it to the `build` task:
93
111
94
112
```groovy
95
-
tasks.build.finalizedBy tasks.jib
113
+
tasks.build.dependsOn tasks.jib
96
114
```
97
115
98
116
Then, ```gradle build``` will build and containerize your application.
99
117
100
118
### Export to a Docker context
101
119
102
-
*Not yet supported*
120
+
Jib can also export a Docker context so that you can build with Docker, if needed:
121
+
122
+
```shell
123
+
gradle jibExportDockerContext
124
+
```
125
+
126
+
The Docker context will be created at `build/jib-docker-context` by default. You can change this directory with the `targetDir` configuration option or the `---jib.dockerDir` parameter:
@@ -110,11 +144,13 @@ Field | Type | Default | Description
110
144
`from` | [`from`](#from-closure) | See [`from`](#from-closure) | Configures the base image to build your application on top of.
111
145
`to` | [`to`](#to-closure) | *Required* | Configures the target image to build your application to.
112
146
`jvmFlags` | `List<String>` | *None* | Additional flags to pass into the JVM when running your application.
113
-
`mainClass` | `String` | Uses the main class defined in the `jar` task | The main class to launch your application from.
114
-
`reproducible` | `boolean` | `true` | Building with the same application contents always generates the same image.<br>Note that this does NOT preserve file timestamps and ownership.
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.
115
149
`format` | `String` | `Docker` | Use `OCI` to build an [OCI container image](https://www.opencontainers.org/).
116
150
`useProjectOnlyCache` | `boolean` | `false` | If set to true, Jib does not share a cache between different Maven projects.
117
151
152
+
*\* Uses the main class defined in the `jar` task or tries to find a valid main class.*
153
+
118
154
<aname="from-closure"></a>`from` is a closure with the following properties:
0 commit comments