@@ -78,8 +78,15 @@ func (p *Planner) getPlan(srcDir string) (*plansdk.Plan, error) {
78
78
// Error #2. An error for missing `libicu`. Adding nix pkg `icu` didn't help. TODO need to resolve this issue.
79
79
RuntimePackages : []string {dotNetPkg },
80
80
81
- BuildStage : & plansdk.Stage {
81
+ InstallStage : & plansdk.Stage {
82
82
InputFiles : []string {"." },
83
+ // --packages stores the downloaded packages in a local directory called nuget-packages
84
+ // Otherwise, the default location is ~/.nuget/packages,
85
+ // which is hard to copy over into StartStage
86
+ Command : "dotnet restore --packages nuget-packages" ,
87
+ },
88
+
89
+ BuildStage : & plansdk.Stage {
83
90
84
91
// TODO modify this command to reduce image size
85
92
//
@@ -88,12 +95,12 @@ func (p *Planner) getPlan(srcDir string) (*plansdk.Plan, error) {
88
95
// - for dotnet publish options: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-publish
89
96
// - for -r options: https://docs.microsoft.com/en-us/dotnet/core/rid-catalog
90
97
// - for publishing a single file: https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli
91
- Command : "dotnet publish" ,
98
+ Command : "dotnet publish -c Publish --no-restore " ,
92
99
},
93
100
StartStage : & plansdk.Stage {
94
101
InputFiles : []string {"." },
95
102
// TODO to invoke single-executable: ./bin/Debug/net6.0/linux-64/publish/<projectName>
96
- Command : "dotnet run" ,
103
+ Command : "dotnet run -c Publish --no-build " ,
97
104
},
98
105
}, nil
99
106
}
0 commit comments