Skip to content

Conversation

@jakecoffman
Copy link
Member

What are you trying to accomplish?

By reducing the amount of layers in the final image we can reduce the load on GHCR.

My strategy here was to stick all the COPY statements, which each produce a layer, into a builder image and then just do one final COPY to move $DEPENDABOT_HOME into it's final place.

On my local machine this reduced the Go image from 80 to 39 layers.

Anything you want to highlight for special attention from reviewers?

How will you know you've accomplished your goal?

The builds will pass. Deploy cautiously as Copilot helped with this.

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.

@jakecoffman
Copy link
Member Author

Closing this out as #13637 has reaped most of the benefits and is quite simple. Love it.

@jeffwidman feel free to reopen if you want to take this further.

@jakecoffman jakecoffman closed this Dec 1, 2025
@jakecoffman jakecoffman deleted the reduce-layers branch December 1, 2025 17:42
@jeffwidman
Copy link
Member

I think there's still potential value here, but we shouldn't really spend any further time on it until we get the rest of the low-hanging fruit, for example:

I think there may be another one or two easy wins, and then it'd be worth measuring this to see how many layers it would further reduce... if it's 5-10 it's worth it, if it's 1-2 then maybe not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants