Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the default base images from Distroless in Jib build plugins #3124

Merged
merged 13 commits into from
Apr 5, 2021

Conversation

chanseokoh
Copy link
Member

@chanseokoh chanseokoh commented Mar 9, 2021

NOTE: this PR is to merge the changes into the feature branch feature-branch-default-base-images. We are going to maintain the feature branch and regularly sync it with the main branch for a while.

The changes are on top of #3123.

  1. For non-WAR projects, the new base images are adoptopenjdk:8-jre and adoptopenjdk:11-jre.
  2. For WAR projects, the new base image is jetty.
  3. For WAR projects, we no longer inherits the entrypoint from the base image. The new default entrypoint is explicitly set to java -jar /user/local/jetty/start.jar. The idea is from Unnecessary overwrites of directories, resulting changes to owners and permissions #1270 (comment).
  4. Also cleans up a few places where Distroless is referenced.

@codecov
Copy link

codecov bot commented Mar 9, 2021

Codecov Report

Merging #3124 (534d646) into master (ff8c5b2) will increase coverage by 0.05%.
The diff coverage is 90.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3124      +/-   ##
============================================
+ Coverage     71.18%   71.24%   +0.05%     
+ Complexity     2331     2325       -6     
============================================
  Files           279      279              
  Lines          9846     9834      -12     
  Branches        990      976      -14     
============================================
- Hits           7009     7006       -3     
  Misses         2491     2491              
+ Partials        346      337       -9     
Impacted Files Coverage Δ Complexity Δ
...mon/IncompatibleBaseImageJavaVersionException.java 100.00% <ø> (ø) 3.00 <0.00> (ø)
...jib/plugins/common/JavaContainerBuilderHelper.java 95.45% <ø> (+0.14%) 21.00 <0.00> (ø)
...b/plugins/common/PluginConfigurationProcessor.java 65.26% <90.00%> (+1.18%) 59.00 <6.00> (-6.00) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff8c5b2...534d646. Read the comment docs.

@chanseokoh
Copy link
Member Author

Adding the kokoro:run did nothing. Did an internal search, and it looks like we have to manually trigger Kokoro builds. Just did that.

@chanseokoh chanseokoh changed the base branch from feature-branch-default-base-images to master April 2, 2021 19:23
@chanseokoh chanseokoh merged commit f20cfcd into master Apr 5, 2021
@chanseokoh chanseokoh deleted the plugin-base-image branch April 5, 2021 15:15
@chanseokoh
Copy link
Member Author

Need to update CHANGELOG. When released, a lot of doc updates too.

@@ -588,7 +589,7 @@ static JavaContainerBuilder getJavaContainerBuilderWithBaseImage(
"mainClass, extraClasspath, jvmFlags, and expandClasspathDependencies "
+ "are ignored for WAR projects"));
}
return null;
return Arrays.asList("java", "-jar", "/usr/local/jetty/start.jar");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR: it was wrong to return this when a custom base image is specified. The issue is fixed later in #3185.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants