From 1971bc2531169d59e0d93cc8c13c5141d83f484c Mon Sep 17 00:00:00 2001 From: Qingyang Chen Date: Tue, 1 May 2018 12:05:28 -0400 Subject: [PATCH] ProposaL: Align jib-maven-plugin configuratoin with jib-gradle-plugin. (#236) --- proposals/maven_configuration_v2.md | 93 +++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 proposals/maven_configuration_v2.md diff --git a/proposals/maven_configuration_v2.md b/proposals/maven_configuration_v2.md new file mode 100644 index 0000000000..459f182145 --- /dev/null +++ b/proposals/maven_configuration_v2.md @@ -0,0 +1,93 @@ +# Proposal: Align `jib-maven-plugin` configuration with `jib-gradle-plugin` + +## Motivation + +`jib-gradle-plugin` introduced a different configuration schema from `jib-maven-plugin`. This schema has many benefits over the original `jib-maven-plugin` configuration. Therefore, to maintain consistency between the two plugins, the `jib-maven-plugin` configuration should be updated to be more similar to the `jib-gradle-plugin` configuration. + +## Goals + +- Have `jib-maven-plugin` configuration be as similar to `jib-gradle-plugin` configuration as possible + +## Non-Goals + +- Maintain compatibility with older versions of `jib-maven-plugin` (we are still in alpha) + +## Current Configuration Schema + +The current `jib-maven-plugin` configuration looks like: + +```xml + + openjdk:alpine + localhost:5000 + my-image + built-with-jib + + osxkeychain + + + -Xms512m + -Xdebug + -Xmy:flag=jib-rules + + mypackage.MyApp + true + OCI + +``` + +And the current `jib-gradle-plugin` configuration looks like: + +```groovy +jib { + from { + image = 'openjdk:alpine' + } + to { + image = 'localhost:5000/my-image/built-with-jib' + credHelper = 'osxkeychain' + } + jvmFlags = ['-Xms512m', '-Xdebug', '-Xmy:flag=jib-rules'] + mainClass = 'mypackage.MyApp' + reproducible = true + format = 'OCI' +} +``` + +## Desired Configuration Schema + +Therefore, the desired `jib-maven-plugin` configuration should look like: + +```xml + + + openjdk:alpine + + + gcr.io/my-gcp-project/my-app + gcr + + + -Xmy:flag=jib-rules + + mypackage.MyApp + true + OCI + +``` + +The key changes are: + +- Removes `registry`, `repository`, and `tag` - these are now defined as one field `to.image`. +- Adds an image configuration object that takes: + - `to` - the image reference, and + - `credHelper` - the credential helper for that image +- The image configuration object configures both the base image (`from`) and the target image (`to`). +- `enableReproducibleBuilds` is renamed to `reproducible`. +- `imageFormat` is renamed to `format`. + +## Implementation Details + +1. Change `BuildConfiguration` to individual `credHelper`s for the base and target images, not as a list. +2. Change the `BuildImageMojo` (and `DockerContextMojo`) schema. + - The only required field now is `to.image`. \ No newline at end of file