-
Notifications
You must be signed in to change notification settings - Fork 168
Issue #527 - Greatly improve rebuild times for docker images ... #531
Conversation
|
@AlexChesser do you have metrics before / after ? |
|
@spboyer I do! I talked about it in summary over here: #527. old-speed: ~3m30s new-speed: ~9s |
|
👍 This leverages Docker caching. Though, we might need to copy the |
|
@mixxorz In my tests, that didn't seem to be required. Based on what I think the .lock.json file is, I don't think it could have an impact (how could a generated dependency tree change if the versions of the source packages don't change) It might be worth asking @DamianEdwards what project.lock.json is for and if we need to copy it over (or should do for best practice) I'm certainly not an expert on exactly what project.lock.json is used for and how it might change. Over time on a long running project I assumed it was 100% deterministic based on project.json |
|
@glennc is best to ask what is appropriate from a Docker perspective. |
|
@spboyer, @peterblazejewicz - any thoughts on whether we can merge this? Let me know if there's anything else I need to do. |
|
I've added a link to talk with video that discusses how to improve Docker experience when working with ASP.NET 5 (Core 1) projects: |
|
Oh! Excellent Feedback, thanks Peter! |
|
May I close this? Two reasons:
Thanks! |
|
@peterblazejewicz I agree with your reasoning, this should be closed. Thanks for the head up! |
|
@AlexChesser Thanks! |
...with unchanged dependencies.
The reason we copy the project.json first is related to the way that
Docker's "union file system" works. Each command in sequence gets cached
on the docker host as a binary. Commands that are "unchanged" from the
previous run will not be run a second time.
By changing the order here, docker's "restart" of a container will only
run a full nuget restore when a project's dependencies change, as opposed
to when any code changes at all.