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
Enhancement: Improve Dockerfile for cached layer handling #2158
Labels
enhancement
New feature or request
Comments
Feel free to submit a PR. I made some Dockerfile changes today, by the way, in case that affected your build time. |
Just saw this, I think my PR #2275 aims to address this issue to some extent. |
yes your PR addresses it for |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What features would you like to see added?
Docker takes too long, couple simple manipulations will drastically improve build times and utilize cached layers, to avoid entire image rebuild on each run. You can see screenshots below, to notice build time differences
More details
something like this would result in a quicker build, given that you use runner that has docker cache, or pull :latest and use as cache. And minimize number of RUN commands, so that it doesn't persist layer after each command
here're the differences:
all steps that i marked, will re-use cached layers, and only app build will re-run on every rebuild of the app
this way, image build will go to seconds, if you use runners that have perstitent docker or use --pull in docker build command, to re-use cached layers (that will add few extra seconds to pull last built image as cache from docker registry)
Below is a working version of Dockerfile that I use it myself
Which components are impacted by your request?
No response
Pictures
Initial Build - before caching or if package-json files not changed
Consequent rebuild without code changes
Code changed in client only
Code of Conduct
The text was updated successfully, but these errors were encountered: