Skip to content
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

Use ruby alpine as base image #13

Closed
wants to merge 2 commits into from
Closed

Conversation

karunsiri
Copy link

@karunsiri karunsiri commented Dec 20, 2022

I believe the dependencies added are the least required by Rails and Puma.

  • build-base for compiling gems using native extensions
  • git is required when running rails new
  • libressl-dev is required by Puma, in case you bind SSL certificates directly
  • libxml2-dev is for XML parser. Like nokogiri.
  • tzdata Timezone

The new Dockerfile will reduce the final image to about 550MB, uncompressed.
image

Changes

  • Adds build arguments: RUBY_VERSION (defaults: 3.1) and NODE_VERSION (defaults: 19)
  • Use ruby alpine as base image.
  • Use multistage build to pull in binaries from node without having to reinstall node.

Contributes to #10

@karunsiri
Copy link
Author

Please consider the fact that most of the time, for alpine images, you will have a harder time figuring out the needed libraries required to build native extension gems. It comes super light weight, but needs super explicit tooling/libraries.

@dhh
Copy link
Member

dhh commented Dec 24, 2022

Yeah I don't think it's worth switching to alpine for this reason. Whole point is for this image to make it super easy for beginners. They can't go debugging dependency issues. Appreciate the attempt, though ✌️❤️.

@dhh dhh closed this Dec 24, 2022
@viktorianer viktorianer mentioned this pull request Dec 24, 2022
@karunsiri karunsiri deleted the alpine-base branch December 26, 2022 08:12
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.

None yet

2 participants