Skip to content

Commit b4cf1d4

Browse files
authored
Updates README for Gradle v0.1.1. (GoogleContainerTools#231)
1 parent 7eb3710 commit b4cf1d4

3 files changed

Lines changed: 55 additions & 7 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)
22
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.google.cloud.tools/jib-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.google.cloud.tools/jib-maven-plugin)
3+
[![Gradle Plugin Portal](https://img.shields.io/badge/gradle%20plugin-v0.1.1-blue.svg)](https://plugins.gradle.org/plugin/com.google.cloud.tools.jib)
34
[![Gitter version](https://img.shields.io/gitter/room/gitterHQ/gitter.svg)](https://gitter.im/google/jib)
45

56
# Jib

‎jib-gradle-plugin/CHANGELOG.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ All notable changes to this project will be documented in this file.
44

55
### Added
66

7-
- Warns if specified `mainClass` is not a valid Java class ([#206](https://github.com/google/jib/issues/206))
8-
- Can specify registry credentials to use directly with `from.auth` and `to.auth` ([#215](https://github.com/google/jib/issues/215))
9-
107
### Changed
118

129
### Fixed
10+
11+
## 0.1.1
12+
13+
### Added
14+
15+
- Warns if specified `mainClass` is not a valid Java class ([#206](https://github.com/google/jib/issues/206))
16+
- Can specify registry credentials to use directly with `from.auth` and `to.auth` ([#215](https://github.com/google/jib/issues/215))

‎jib-gradle-plugin/README.md‎

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)
2-
[![Gradle Plugin Portal](https://img.shields.io/badge/gradle%20plugin-v0.1.0-blue.svg)](https://plugins.gradle.org/plugin/com.google.cloud.tools.jib)
2+
[![Gradle Plugin Portal](https://img.shields.io/badge/gradle%20plugin-v0.1.1-blue.svg)](https://plugins.gradle.org/plugin/com.google.cloud.tools.jib)
33
[![Gitter version](https://img.shields.io/gitter/room/gitterHQ/gitter.svg)](https://gitter.im/google/jib)
44

55
# Jib - Containerize your Gradle Java project
@@ -14,7 +14,6 @@ For the Maven plugin, see the [jib-maven-plugin project](../jib-maven-plugin).
1414
These features are not currently supported but will be added in later releases.
1515

1616
* Support for WAR format
17-
* Define credentials in configuration
1817
* Export to a Docker context
1918
* Run and debug the built container
2019

@@ -28,7 +27,7 @@ In your Gradle Java project, add the plugin to your `build.gradle`:
2827

2928
```groovy
3029
plugins {
31-
id 'com.google.cloud.tools.jib' version '0.1.0'
30+
id 'com.google.cloud.tools.jib' version '0.1.1'
3231
}
3332
```
3433

@@ -122,13 +121,22 @@ Property | Type | Default | Description
122121
--- | --- | --- | ---
123122
`image` | `String` | `gcr.io/distroless/java` | The image reference for the base image.
124123
`credHelper` | `String` | *None* | Suffix for the credential helper that can authenticate pulling the base image (following `docker-credential-`).
124+
`auth` | ['auth`](#auth-closure) | *None* | Specify credentials directly (alternative to `credHelper`).
125125

126126
<a name="to-closure"></a>`to` is a closure with the following properties:
127127

128128
Property | Type | Default | Description
129129
--- | --- | --- | ---
130130
`image` | `String` | *Required* | The image reference for the target image.
131131
`credHelper` | `String` | *None* | Suffix for the credential helper that can authenticate pulling the base image (following `docker-credential-`).
132+
`auth` | ['auth`](#auth-closure) | *None* | Specify credentials directly (alternative to `credHelper`).
133+
134+
<a name="auth-closure"></a>`auth` is a closure with the following properties:
135+
136+
Property | Type
137+
--- | ---
138+
`username` | `String`
139+
`password` | `String`
132140

133141
### Example
134142

@@ -189,7 +197,42 @@ jib {
189197

190198
#### Using Specific Credentials
191199

192-
*Not yet supported*
200+
You can specify credentials directly in the extension for the `from` and/or `to` images.
201+
202+
```xml
203+
jib {
204+
from {
205+
image = 'aws_account_id.dkr.ecr.region.amazonaws.com/my-base-image'
206+
auth {
207+
username = USERNAME // Defined in 'gradle.properties'.
208+
password = PASSWORD
209+
}
210+
}
211+
to {
212+
image = 'gcr.io/my-gcp-project/my-app'
213+
auth {
214+
username = 'oauth2accesstoken'
215+
password = 'gcloud auth print-access-token'.execute().text.trim()
216+
}
217+
}
218+
}
219+
```
220+
221+
These credentials can be stored in `gradle.properties`, retrieved from a command (like `gcloud auth print-access-token`), or read in from a file.
222+
223+
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)):
224+
225+
```xml
226+
jib {
227+
to {
228+
image = 'gcr.io/my-gcp-project/my-app'
229+
auth {
230+
username = '_json_key'
231+
password = file('keyfile.json').text
232+
}
233+
}
234+
}
235+
```
193236

194237
## How Jib Works
195238

0 commit comments

Comments
 (0)