Skip to content

Commit fe5bd82

Browse files
authored
Updates the README to fit v0.1.1. (GoogleContainerTools#83)
1 parent a4af5a7 commit fe5bd82

1 file changed

Lines changed: 56 additions & 5 deletions

File tree

‎README.md‎

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Jib is a Maven plugin for building container images for your Java applications.
1515

1616
<!--* Reproducible - Rebuilding your container image with the same contents always generates the same image. Never trigger an unnecessary update again.-->
1717

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.*
1919

2020
## Quickstart
2121

@@ -27,7 +27,7 @@ In your Maven Java project, add the plugin to your `pom.xml`:
2727
<plugin>
2828
<groupId>com.google.cloud.tools</groupId>
2929
<artifactId>jib-maven-plugin</artifactId>
30-
<version>0.1.0</version>
30+
<version>0.1.1</version>
3131
<configuration>
3232
<registry>myregistry</registry>
3333
<repository>myapp</repository>
@@ -41,7 +41,7 @@ Configure the plugin by changing `registry`, `repository`, and `credHelpers` acc
4141

4242
#### Using Google Container Registry (GCR)...
4343

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.*
4545

4646
For example, to build the image `gcr.io/my-gcp-project/my-app`, the configuration would be:
4747

@@ -54,7 +54,7 @@ For example, to build the image `gcr.io/my-gcp-project/my-app`, the configuratio
5454

5555
#### Using Amazon Elastic Container Registry (ECR)...
5656

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.*
5858

5959
For example, to build the image `aws_account_id.dkr.ecr.region.amazonaws.com/my-app`, the configuration would be:
6060

@@ -144,6 +144,57 @@ In this configuration, the image is:
144144
</configuration>
145145
```
146146

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)
158+
* AWS Elastic Container Registry: [`docker-credential-ecr-login`](https://github.com/awslabs/amazon-ecr-credential-helper)
159+
* Docker Hub Registry: [`docker-credential-*`](https://github.com/docker/docker-credential-helpers)
160+
<!--* Azure Container Registry: [`docker-credential-acr-*`](https://github.com/Azure/acr-docker-credential-helper)
161+
-->
162+
163+
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+
147198
## How Jib Works
148199

149200
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.
156207

157208
* Only supports Maven projects.
158209
* Does not build OCI images.
159-
* Pushing to Docker Hub is currently not supported.
160210
* Cannot build directly to a Docker daemon.
211+
* Pushing to Azure Container Registry is not currently supported.
161212

162213
## Frequently Asked Questions (FAQ)
163214

0 commit comments

Comments
 (0)