Substantially reworked Dockerfile #1935
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: this is a carbon copy of mastodon#20678, which I don't believe will see quick adoption, but I wanted for Glitch to have a better UX for working with containers as well
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.).The the already existing pipeline it should be split its runtime in half, maybe even reduce it be a larger amount.