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 fe5bd82
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+56-5Lines changed: 56 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Jib is a Maven plugin for building container images for your Java applications.
15
15
16
16
<!--* Reproducible - Rebuilding your container image with the same contents always generates the same image. Never trigger an unnecessary update again.-->
17
17
18
-
***Native** - Reduce your CLI dependencies. Build your Docker image from within Maven <!--or Gradle--> and push to any registry of your choice. No more writing Dockerfiles and calling docker build/push.
18
+
***Native** - Reduce your CLI dependencies. Build your Docker image from within Maven <!--or Gradle--> and push to any registry of your choice. *No more writing Dockerfiles and calling docker build/push.*
19
19
20
20
## Quickstart
21
21
@@ -27,7 +27,7 @@ In your Maven Java project, add the plugin to your `pom.xml`:
27
27
<plugin>
28
28
<groupId>com.google.cloud.tools</groupId>
29
29
<artifactId>jib-maven-plugin</artifactId>
30
-
<version>0.1.0</version>
30
+
<version>0.1.1</version>
31
31
<configuration>
32
32
<registry>myregistry</registry>
33
33
<repository>myapp</repository>
@@ -41,7 +41,7 @@ Configure the plugin by changing `registry`, `repository`, and `credHelpers` acc
41
41
42
42
#### Using Google Container Registry (GCR)...
43
43
44
-
*Make sure you have the [`docker-credential-gcr` command line tool](https://cloud.google.com/container-registry/docs/advanced-authentication#docker_credential_helper). Jib automatically uses `docker-credential-gcr` for obtaining credentials. To use a different credential helper, set the [`credHelpers`](#extended-usage) configuration.*
44
+
*Make sure you have the [`docker-credential-gcr` command line tool](https://cloud.google.com/container-registry/docs/advanced-authentication#docker_credential_helper). Jib automatically uses `docker-credential-gcr` for obtaining credentials. See [Authentication Methods](#authentication-methods) for other ways of authenticating.*
45
45
46
46
For example, to build the image `gcr.io/my-gcp-project/my-app`, the configuration would be:
47
47
@@ -54,7 +54,7 @@ For example, to build the image `gcr.io/my-gcp-project/my-app`, the configuratio
54
54
55
55
#### Using Amazon Elastic Container Registry (ECR)...
56
56
57
-
*Make sure you have the [`docker-credential-ecr-login` command line tool](https://github.com/awslabs/amazon-ecr-credential-helper). Jib automatically uses `docker-credential-ecr-login` for obtaining credentials. To use a different credential helper, set the [`credHelpers`](#extended-usage) configuration.*
57
+
*Make sure you have the [`docker-credential-ecr-login` command line tool](https://github.com/awslabs/amazon-ecr-credential-helper). Jib automatically uses `docker-credential-ecr-login` for obtaining credentials. To use a different credential helper, set the [`credHelpers`](#extended-usage) configuration. See [Authentication Methods](#authentication-methods) for other ways of authenticating.*
58
58
59
59
For example, to build the image `aws_account_id.dkr.ecr.region.amazonaws.com/my-app`, the configuration would be:
60
60
@@ -144,6 +144,57 @@ In this configuration, the image is:
144
144
</configuration>
145
145
```
146
146
147
+
### Authentication Methods
148
+
149
+
Pushing/pulling from private registries require authorization credentials. These can [retrieved using Docker credential helpers](#using-docker-credential-helpers) or [defined in your Maven settings](#using-maven-settings).
150
+
151
+
#### Using Docker Credential Helpers
152
+
153
+
Docker credential helpers are CLI tools that handle authentication with various registries.
154
+
155
+
Some common credential helpers include:
156
+
157
+
* Google Container Registry: [`docker-credential-gcr`](https://cloud.google.com/container-registry/docs/advanced-authentication#docker_credential_helper)
Configure credential helpers to use by specifying them in the `credHelpers` configuration.
164
+
165
+
*Example configuration:*
166
+
```xml
167
+
<configuration>
168
+
...
169
+
<credHelpers>
170
+
<credHelper>osxkeychain</credHelper>
171
+
</credHelpers>
172
+
...
173
+
</configuration>
174
+
```
175
+
176
+
#### Using Maven Settings
177
+
178
+
Registry credentials can be added to your [Maven settings](https://maven.apache.org/settings.html). These credentials will be used if credentials could not be found in any specified Docker credential helpers.
179
+
180
+
*Example `settings.xml`:*
181
+
```xml
182
+
<settings>
183
+
...
184
+
<servers>
185
+
...
186
+
<server>
187
+
<id>MY_REGISTRY</id>
188
+
<username>MY_USERNAME</username>
189
+
<password>MY_SECRET</password>
190
+
</server>
191
+
</servers>
192
+
</settings>
193
+
```
194
+
195
+
* The `id` field should be the registry server these credentials are for.
196
+
* We *do not* recommend putting your raw password in `settings.xml`.
197
+
147
198
## How Jib Works
148
199
149
200
Whereas traditionally a Java application is built as a single image layer with the application JAR, Jib's build strategy separates the Java application into multiple layers for more granular incremental builds. When you change your code, only your changes are rebuilt, not your entire application. These layers, by default, are layered on top of a [distroless](https://github.com/GoogleCloudPlatform/distroless) base image.
@@ -156,8 +207,8 @@ These limitations will be fixed in later releases.
156
207
157
208
* Only supports Maven projects.
158
209
* Does not build OCI images.
159
-
* Pushing to Docker Hub is currently not supported.
160
210
* Cannot build directly to a Docker daemon.
211
+
* Pushing to Azure Container Registry is not currently supported.
0 commit comments