Ensure Dockerfile installs commonly needed packages #46953
Merged
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.
Motivation / Background
While libvips is an example of a dependency needed to build a native gem, it is not an exhaustive list.
This pull request always includes
build-essential
as installing native gems is common need, not just for applications that include active storage.Detail
Additional information
While this started out simple, it became a minor yak shaving event.
Node also has native modules, and in order to install them you need node-gyp, pkg-config, and python. And the way that python is packaged changed from debian buster to debian bullseye. So heads up: wart warning here, but one that only affects node users, and one that is unlikely to be visible externally as it merely substitutes the name of one python package for another based on the ruby version. See code/comments in app_base.rb for details.
Taking a step back, if we are installing packages, ruby:slim is a better starting point than ruby. It installs a few less packages by default, but also removed docs, man pages, etc. See https://stackoverflow.com/questions/59794891/how-does-debian-differ-from-debian-slim
This pull request explicitly installs libraries for sqlite3, postgresql, mysql, and redis as they are common requirements and don't take up much space.
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
A changelog entry is not needed for this change.