-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Split off Dockerfile components for faster build times #20678
Conversation
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.
Woo, speed!
May I interest you in #20837 to make it a bit slimmer? |
@bobrik Thank you for those excellent suggestions, I've included most of them! |
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.
I deployed this with my comments applied and it seems to be working.
This PR splits the current monolithic
Dockerfile
into two parts, one of which is now executed in a separate pipeline (and repository).Why
The current
Dockerfile
builds a new version of Ruby every time the image is built. That's wasteful and slow, especially since we're building against other targets thanlinux/amd64
(which is even slower; at least until GitHub Actions finally gets nativelinux/arm64
support).Additionally, the
Dockerfile
now relies on the official NodeJS and Ruby images from the Docker Hub to build its assets, meaning there is no more overhead for the contributors in this repository to care for updating/maintaining Ruby and NodeJS installations and stacks (but rather source them from the Hub directly).Consequences
jemalloc
is involved.mastodon
organization as soon as it's feasible. We can also add any number of Ruby versions or supported architectures to the image itself, should it become necessary.containerd
.Notes
Most of the stuff I either removed or left out was cosmetic or "solved" by using a different syntax (e.g.
WORKDIR
instead ofcd
, passing the--chown
flag toADD
instead of usingchown
manually etc.)