File tree Expand file tree Collapse file tree
src/PostSharp.Engineering.BuildTools/Docker Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ RUN & .\dotnet-install.ps1 -Version 9.0.310 -InstallDir 'C:\Program Files\dotnet
6565# .NET Dump Tool
6666RUN dotnet tool install --global dotnet-dump;
6767
68+ ENV PATH="C:\U sers\C ontainerAdministrator\. dotnet\t ools;${PATH}"
69+
6870
6971# Epilogue
7072# Create directories for mountpoints
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ RUN & .\dotnet-install.ps1 -Version 9.0.310 -InstallDir 'C:\Program Files\dotnet
6565# .NET Dump Tool
6666RUN dotnet tool install --global dotnet-dump;
6767
68+ ENV PATH="C:\Users\ContainerAdministrator\.dotnet\tools;${PATH}"
69+
6870
6971# Install Node.js
7072RUN Invoke-WebRequest -Uri "https://nodejs.org/dist/v22.0.0/node-v22.0.0-win-x64.zip" -OutFile node.zip; `
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ RUN & .\dotnet-install.ps1 -Version 9.0.310 -InstallDir 'C:\Program Files\dotnet
6565# .NET Dump Tool
6666RUN dotnet tool install --global dotnet-dump;
6767
68+ ENV PATH="C:\Users\ContainerAdministrator\.dotnet\tools;${PATH}"
69+
6870
6971# Install Node.js
7072RUN Invoke-WebRequest -Uri "https://nodejs.org/dist/v22.0.0/node-v22.0.0-win-x64.zip" -OutFile node.zip; `
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ RUN & .\dotnet-install.ps1 -Version 9.0.310 -InstallDir 'C:\Program Files\dotnet
6565# .NET Dump Tool
6666RUN dotnet tool install --global dotnet-dump;
6767
68+ ENV PATH="C:\Users\ContainerAdministrator\.dotnet\tools;${PATH}"
69+
6870
6971# Epilogue
7072# Create directories for mountpoints
Original file line number Diff line number Diff line change 1- // Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details.
2-
3- using JetBrains . Annotations ;
4- using System . IO ;
5-
6- namespace PostSharp . Engineering . BuildTools . Docker ;
7-
8- [ PublicAPI ]
9- public sealed class DotNetDumpComponent : ContainerComponent
10- {
11- public override string Name => ".NET Dump Tool" ;
12-
13- public override ContainerComponentKind Kind => ContainerComponentKind . DotNetDump ;
14-
15- public override void WriteDockerfile ( TextWriter writer , ContainerOperatingSystem operatingSystem )
16- {
17- writer . WriteLine ( "RUN dotnet tool install --global dotnet-dump;" ) ;
18- }
1+ // Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details.
2+
3+ using JetBrains . Annotations ;
4+ using System . IO ;
5+
6+ namespace PostSharp . Engineering . BuildTools . Docker ;
7+
8+ [ PublicAPI ]
9+ public sealed class DotNetDumpComponent : ContainerComponent
10+ {
11+ public override string Name => ".NET Dump Tool" ;
12+
13+ public override ContainerComponentKind Kind => ContainerComponentKind . DotNetDump ;
14+
15+ public override void WriteDockerfile ( TextWriter writer , ContainerOperatingSystem operatingSystem )
16+ {
17+ writer . WriteLine ( "RUN dotnet tool install --global dotnet-dump;" ) ;
18+
19+ // The `dotnet tool install --global` shim is placed in %USERPROFILE%\.dotnet\tools, which is
20+ // not on PATH by default. Add it so the tool (and any other globally installed .NET tools)
21+ // is callable by name during container runs.
22+ writer . WriteLine ( ) ;
23+ writer . WriteLine ( """ENV PATH="C:\Users\ContainerAdministrator\.dotnet\tools;${PATH}" """ . TrimEnd ( ) ) ;
24+ }
1925}
You can’t perform that action at this time.
0 commit comments