Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cake Windows Image Stipping out System Paths from PATH Variable #60

Open
poiriermike opened this issue Jan 9, 2025 · 0 comments
Open

Comments

@poiriermike
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant