Skip to content

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

Description

@poiriermike

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions