Speed up docker builds
See original GitHub issueIs your feature request related to a problem? Please describe. Docker builds are too slow. I understand the first build will be slow because it has to download tons of things but if someone makes any change to Gemfile then it again takes forever to fetch in all those gems and rebuild the thing.
Describe the solution you’d like The basic thing which can be done is to cache the downloaded gems in a docker volume or use a proxy gemserver which caches the gems required and speeds up the builds.
For caching based approach following might be helpful:
You basically have to setup a gem server using https://github.com/bundler/gemstash and modify source
in your Gemfile such that it’s used only when reachable.
https://stackoverflow.com/questions/39386806/ignore-gemfile-source-if-source-not-accessible
For caching the downloads in a separate volume: https://blog.bigbinary.com/2018/07/25/speeding-up-docker-image-build-process-of-a-rails-application.html
Additional context This is a good starting issue and if anyone is interested in working on this please let me know.
Are you working on this? (Yes/No) Currently I am mentoring this.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Configuring gemstash for caching in development seems an overkill. If changing something in Gemfile causes downloading whole gems again, then that is bug in our current Docker setup
No activity on this issue for a prolonged duration, will be closed in few days if no further activities in next 7 days