Skip to content

Conversation

@yeikel
Copy link
Contributor

@yeikel yeikel commented Dec 4, 2025

What are you trying to accomplish?

Builds on work like #13638 and consolidates the copy operations behind a builder

How will you know you've accomplished your goal?

Existing tests pass, we create less number of layers for the image

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

@github-actions github-actions bot added the L: java:maven Maven packages via Maven label Dec 4, 2025
@yeikel yeikel force-pushed the consolidate-single-layer branch 2 times, most recently from 1689427 to 41ec6ba Compare December 4, 2025 12:52
@yeikel yeikel marked this pull request as ready for review December 4, 2025 12:58
@yeikel yeikel requested a review from a team as a code owner December 4, 2025 12:58
@yeikel
Copy link
Contributor Author

yeikel commented Dec 4, 2025

Hey @jeffwidman

What do you think about this approach?

I understand we don’t want to consolidate just for the sake of it, but this feels like a neat trick.

The idea came to me while working on #13515. I believe the added complexity is justified, and the extra builder shouldn’t increase build time since we need the base image to be pulled for the final image anyway. 👀

If this looks good, we can apply a similar change to the other ecosystems (or ask Copilot to generate them).

@yeikel yeikel force-pushed the consolidate-single-layer branch from 41ec6ba to dc9e99f Compare December 4, 2025 13:02
# syntax=docker.io/docker/dockerfile:1.20
# This cannot be inlined below (e.g., COPY --from=maven:...) because Dependabot does not support that syntax yet
FROM maven:3.9.9 as maven
FROM maven:3.9.9 AS maven
Copy link
Contributor Author

@yeikel yeikel Dec 4, 2025

Choose a reason for hiding this comment

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

Not strictly necessary for this PR but not big enough for a separate PR

Using as instead of AS leads to a docker linting warning that is noisy

WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match

@yeikel yeikel force-pushed the consolidate-single-layer branch 4 times, most recently from 24096bf to a1de2ab Compare December 6, 2025 23:12
@yeikel yeikel force-pushed the consolidate-single-layer branch from a1de2ab to 5a9b50b Compare December 9, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L: java:maven Maven packages via Maven

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant