question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Speed up docker builds

See original GitHub issue

Is 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:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
tachyonscommented, Apr 4, 2019

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

0reactions
github-actions[bot]commented, Mar 4, 2020

No activity on this issue for a prolonged duration, will be closed in few days if no further activities in next 7 days

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Tips to Speed up Your Docker Image Build - vsupalov.com
5 Tips to Speed up Your Docker Image Build · Tip 1: Can you avoid building images? ¶ · Tip 2: Structure your...
Read more >
Six Ways to Build Docker Images Faster (Even in Seconds)
In this article, we'll dockerize a simple application, then use several methods for speeding up build time and consider their nuances.
Read more >
Speed Up Your Development Flow With These Dockerfile Best ...
Incremental builds · Keep live reload active between the host and the container · Build consistently from sources · Multi-stage and targets to ......
Read more >
How to go from slow to fast docker build with example
In this post, we will see a docker build example of a node js API application starting from slow and ending up in...
Read more >
Tips for optimizing Docker builds - CircleCI
Tips for optimizing Docker builds · Ephemeral containers. The image defined by your Dockerfile should generate containers that are ephemeral.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found