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

Use adoptopenjdk base image instead of openjdk in the Jib CLI #3108

Merged
merged 4 commits into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions jib-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
### Added

### Changed
- Changed the default base image of the Jib CLI jar command from `OpenJDK` to `AdoptOpenJDK`. ([#3108](https://github.com/GoogleContainerTools/jib/pull/3108]))
mpeddada1 marked this conversation as resolved.
Show resolved Hide resolved

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public static JibContainerBuilder toJibContainerBuilder(
} else {
containerBuilder =
(processor.getJarJavaVersion() <= 8)
? Jib.from("openjdk:8-jre-slim")
: Jib.from("openjdk:11-jre-slim");
? Jib.from("adoptopenjdk:8-jre")
: Jib.from("adoptopenjdk:11-jre");
}

List<FileEntriesLayer> layers = processor.createLayers();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void testToJibContainer_defaultBaseImage_java8()
mockStandardExplodedProcessor, mockJarCommand, mockCommonCliOptions, mockLogger);
ContainerBuildPlan buildPlan = containerBuilder.toContainerBuildPlan();

assertThat(buildPlan.getBaseImage()).isEqualTo("openjdk:8-jre-slim");
assertThat(buildPlan.getBaseImage()).isEqualTo("adoptopenjdk:8-jre");
}

@Test
Expand All @@ -83,7 +83,7 @@ public void testToJibContainer_defaultBaseImage_java9()
mockStandardExplodedProcessor, mockJarCommand, mockCommonCliOptions, mockLogger);
ContainerBuildPlan buildPlan = containerBuilder.toContainerBuildPlan();

assertThat(buildPlan.getBaseImage()).isEqualTo("openjdk:11-jre-slim");
assertThat(buildPlan.getBaseImage()).isEqualTo("adoptopenjdk:11-jre");
}

@Test
Expand All @@ -108,7 +108,7 @@ public void testToJibContainerBuilder_explodedStandard_basicInfo()
mockStandardExplodedProcessor, mockJarCommand, mockCommonCliOptions, mockLogger);
ContainerBuildPlan buildPlan = containerBuilder.toContainerBuildPlan();

assertThat(buildPlan.getBaseImage()).isEqualTo("openjdk:8-jre-slim");
assertThat(buildPlan.getBaseImage()).isEqualTo("adoptopenjdk:8-jre");
assertThat(buildPlan.getPlatforms()).isEqualTo(ImmutableSet.of(new Platform("amd64", "linux")));
assertThat(buildPlan.getCreationTime()).isEqualTo(Instant.EPOCH);
assertThat(buildPlan.getFormat()).isEqualTo(ImageFormat.Docker);
Expand Down Expand Up @@ -153,7 +153,7 @@ public void testToJibContainerBuilder_packagedStandard_basicInfo()
mockStandardPackagedProcessor, mockJarCommand, mockCommonCliOptions, mockLogger);
ContainerBuildPlan buildPlan = containerBuilder.toContainerBuildPlan();

assertThat(buildPlan.getBaseImage()).isEqualTo("openjdk:8-jre-slim");
assertThat(buildPlan.getBaseImage()).isEqualTo("adoptopenjdk:8-jre");
assertThat(buildPlan.getPlatforms()).isEqualTo(ImmutableSet.of(new Platform("amd64", "linux")));
assertThat(buildPlan.getCreationTime()).isEqualTo(Instant.EPOCH);
assertThat(buildPlan.getFormat()).isEqualTo(ImageFormat.Docker);
Expand Down Expand Up @@ -199,7 +199,7 @@ public void testToJibContainerBuilder_explodedLayeredSpringBoot_basicInfo()
mockSpringBootExplodedProcessor, mockJarCommand, mockCommonCliOptions, mockLogger);
ContainerBuildPlan buildPlan = containerBuilder.toContainerBuildPlan();

assertThat(buildPlan.getBaseImage()).isEqualTo("openjdk:8-jre-slim");
assertThat(buildPlan.getBaseImage()).isEqualTo("adoptopenjdk:8-jre");
assertThat(buildPlan.getPlatforms()).isEqualTo(ImmutableSet.of(new Platform("amd64", "linux")));
assertThat(buildPlan.getCreationTime()).isEqualTo(Instant.EPOCH);
assertThat(buildPlan.getFormat()).isEqualTo(ImageFormat.Docker);
Expand Down Expand Up @@ -244,7 +244,7 @@ public void testToJibContainerBuilder_packagedSpringBoot_basicInfo()
mockSpringBootPackagedProcessor, mockJarCommand, mockCommonCliOptions, mockLogger);
ContainerBuildPlan buildPlan = containerBuilder.toContainerBuildPlan();

assertThat(buildPlan.getBaseImage()).isEqualTo("openjdk:8-jre-slim");
assertThat(buildPlan.getBaseImage()).isEqualTo("adoptopenjdk:8-jre");
assertThat(buildPlan.getPlatforms()).isEqualTo(ImmutableSet.of(new Platform("amd64", "linux")));
assertThat(buildPlan.getCreationTime()).isEqualTo(Instant.EPOCH);
assertThat(buildPlan.getFormat()).isEqualTo(ImageFormat.Docker);
Expand Down