cake-build / cake-build/docker
Cake Windows Image Stipping out System Paths from PATH Variable
- Dominant language
- C#
- Stars
- 22
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
# Description
When running any of the Windows cake docker images, the PATH environment variable is not being set correctly and system paths have been stripped. This includes any references to system utilities and Powershell. This prevents the cake tool from being used within build automation (such as GitHub or GitLab) as it relies on Powershell being within the system PATH.
When execing into into a base `mcr.microsoft.com/powershell:windowsservercore-ltsc2022` contaioner, the path is
```
C:\>echo %PATH%
C:\Program Files\PowerShell\latest;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\ContainerAdministrator\AppData\Local\Microsoft\WindowsApps;
```
When execing into a `cakebuild/cake:sdk-8.0-windowsservercore-ltsc2022` container, the path is
```
C:\src>echo %PATH%
/cake_build/tools;/cake_build;;C:\Program Files\dotnet
```
It appears this is a consequence of https://github.com/cake-build/docker/blob/main/src/Windows.Dockerfile#L11 as the variable references to ${PATH} in line 11 is empty.
# Expected Behaviour
The system paths are included in addition to the cake paths in the system `PATH` variable.
# Actual Behaviour
The system paths are overridden by the cake paths in the system `PATH` variable.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.