-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
fix: Exclude .deb files from release Docker image #5068
Conversation
I guess the "semantic pull request" check is failing because it wants a prefix on the PR title, but I'm not sure what would be most appropriate. It's not really a "feature", so maybe "perf"? |
Good question. code-server/.github/semantic.yaml Lines 37 to 66 in 5bc26e9
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are some excellent savings. The multi-stage build is clever! Thanks for the improvement!
Codecov Report
@@ Coverage Diff @@
## main #5068 +/- ##
=======================================
Coverage 71.30% 71.30%
=======================================
Files 30 30
Lines 1683 1683
Branches 373 373
=======================================
Hits 1200 1200
Misses 413 413
Partials 70 70 Continue to review full report at Codecov.
|
Echoing Asher, those are some huge improvements. Thank you so much for doing this! |
Currently, the
codercom/code-server
Docker image includes a copy of the release's .deb package files, even though they're only used in an intermediate layer. What's more, it includes packages from every architecture, not just the one being released.This patch fixes this by updating the Dockerfile to use a multi-stage build. First, the packages are copied from the local build context into a temporary directory in a "scratch" build stage. Then, this directory is mounted into the main build, so that the appropriate .deb file can be installed without ever being actually stored in the image.
In my testing (with the 4.2.0 packages for linux-amd64) this reduces the total compressed and uncompressed size by a fairly substantial amount:
Partially fixes #4112