Skip to content

Conversation

@ZohebShaikh
Copy link
Contributor

@ZohebShaikh ZohebShaikh commented Jan 5, 2026

  1. Use multistage build for smaller image size ( before: 1.9GB Now: 13MB(scratch) Now: 21MB with alpine as final base image)
  2. Update cache stages to use mount type = cache
  3. Run as nonroot user

@ZohebShaikh ZohebShaikh requested a review from a team January 5, 2026 08:19
@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.27%. Comparing base (5eda1d2) to head (983d19e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #102   +/-   ##
=======================================
  Coverage   49.27%   49.27%           
=======================================
  Files          13       13           
  Lines         621      621           
=======================================
  Hits          306      306           
  Misses        315      315           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ZohebShaikh ZohebShaikh requested a review from tpoliaw January 5, 2026 16:35
Copy link
Contributor

@tpoliaw tpoliaw left a comment

Choose a reason for hiding this comment

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

Looks ok, How does the caching using --mount=type=cache... work with the GHA level caching? Are both still needed?

@tpoliaw
Copy link
Contributor

tpoliaw commented Jan 5, 2026

There was also some discussion about whether having a full OS environment was useful for debugging

@ZohebShaikh
Copy link
Contributor Author

Should we publish two sets of images

  1. 1.9GB as glazed:<version>-debug
  2. 13MB as glazed:<version>

This will help to make the production builds to deployed faster without adding much overhead.

For the previous question about cache. They are 2 different cache there

  1. GHA cache -> This is for caching the images rather than internal Dockerfile stages
    Docs about cache in the Dockerfile not getting cached here

  2. Cache for the internal builds (Dockerfile Cache) -> I had a look at the documentation and this the recommended way to use the cache for compiled languages. you can see the go example here

@ZohebShaikh
Copy link
Contributor Author

After offline discussion, It was decided that using alpine image (3.7 MB) as the final build is better than scratch as it gives us BusyBox,shell,vi,.. which is useful for debugging.

@ZohebShaikh ZohebShaikh merged commit b6e2749 into main Jan 6, 2026
7 checks passed
@ZohebShaikh ZohebShaikh deleted the dockerfile-optimization branch January 6, 2026 13:55
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