-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Dockerfile does not use caching for package restore #1312
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
Comments
It turns out this is actually a regression/fix from a previous commit. |
The reason we copy the project.json and do a "dotnet restore" before copying and compiling the rest of the project is for the massive performance gains when developing. (cached build = 0:09, fresh = 3:30) If dependencies are unchanged a new docker-build/run will complete in seconds as opposed to minutes. (See benchmarks from comment 1 in the thread) The team over at Omnisharp OmniSharp/generator-aspnet#531 seemed to like the idea, but pointed me here.
In practice, in my tests, this has not been a problem. However that doesn't mean it might not be. It is a little more convoluted but it will make a developer's life a LOT easier over the course of a project's lifecycle. 4 minute compile time per change is coffee break time, while 9 seconds feel OK. or run restore a second time to re-write the .lock.json file locally. That would also be much faster as the packages would already be downloaded. @ahmetalpbalkan, @glennc Thoughts? Ohh! Just noticed this as well: https://channel9.msdn.com/Blogs/Seth-Juarez/Steve-Lasker-on-Docker-Tools-for-Visual-Studioif you watch at 8:30, Steve Lasker also prefers to run the copy project.json option enabled. |
This issue is being closed because it has not been updated in 3 months. We apologize if this causes any inconvenience. We ask that if you are still encountering this issue, please log a new issue with updated information and we will investigate. |
Per the discussion inside my OmniSharp pull request OmniSharp/generator-aspnet#531 the current state of the dockerfile in the aspnet/home repo does not use docker caching on DNU RESTORE (soon to be dotnet restore)
A small fix to the sample dockerfile can make the compile time of "second deploy" in docker 23x faster
old-speed for every deploy & first deploy under new method: ~3m30s
Start: 06:03:13.313
Finish: 06:06:40.640
new-speed - second & subsequent deploys if dependencies are unchanged: ~9s
Start: 06:00:36:036
Finish: 06:00:45:045
I also posted the FULL LOG of the difference over here: aspnet/aspnet-docker#123
The text was updated successfully, but these errors were encountered: