-
Notifications
You must be signed in to change notification settings - Fork 169
Docker build/rebuild of ASPNET project takes a long time. #123
Comments
This is a really interesting idea.
The current purpose of this particular image is for it to be a minimal runtime image: #28 (comment) ... cached dependencies may not be appropriate for that. |
@AlexChesser have you considered doing an initial |
@friism yes, I realize there would be considerable bloat caused by this, but I thought it would make a significant impact on cycles of dev time. But you're right, locally my "base image" expands to 1.4gb from ~800meg @ahmetalpbalkan of course! that makes a lot of sense. Altering the source dockerfile from
to
would mean the nuget restore would only run when dependencies change... though all of them would be downloaded again every time one dependency updated. I guess there isn't a clear answer, but at the very least it is food for thought. Maybe a new image stream could be created called microsoft/aspnet-quickbuild which sits "on top" of the minimum image... Or documentation could be expanded to introduce those patterns. |
actually - even in the dockerfile above, I guess I wouldn't need the second DNU restore |
@AlexChesser yes that's the whole point. |
Ok, so I've gone ahead and sent a PR to the omnisharp project so the default docker-file is designed more optimally. If they merge that in then end-users won't be over-burdened but this docker image won't have to pull in unnecessary dependencies. I think that is also in keeping with the needs of this image which is to be bare-bones. Probably safe to close this with a "fixed upstream" comment. |
Thanks. |
Currently, building a typical ASPNET project on docker requires an extremely long
DNU RESTORE
to run every time you build a project.A far more efficient way of doing this would be to pre-load the most common nuget packages on the image in order to ensure the end user's DNU RESTORE only takes the packages they need which are different from the standard loadout.
note for example the extension I've written to the existing dockerfile here:
https://github.com/AlexChesser/aspnet-docker/blob/master/1.0.0-rc1-update1-quickbuild/Dockerfile#L44-L78
since all nuget packages are redownloaded every time a user changes the binary redeploy time is exceptionally slow.
compare the rebuild of a dockerfile using
FROM microsoft/aspnet
to the output of one using
FROM microsoft/aspnet-quickbuild
FROM microsoft/aspnet
Start: 06:03:13:313
Finish: 06:06:40:640
FROM microsoft/aspnet
Start: 06:00:36:036
Finish: 06:00:45:045
The text was updated successfully, but these errors were encountered: