drone-git icon indicating copy to clipboard operation
drone-git copied to clipboard

Cleanup Windows Dockerfile

Open julmb opened this issue 2 years ago • 0 comments

This is based on PR #40.

The Dockerfile for the Windows Server 2022 image contains several lines that are not/no longer needed.

  1. As is, the PATH contains the PowerShell directory a whopping 3 times.
    PS C:\> $env:PATH
    C:\Program Files\PowerShell;C:\Windows\system32;C:\Windows;;C:\Program Files\PowerShell;;C:\Program Files\PowerShell
    
    It is probably safe to remove this (4f27d7ccce337b41b79b16f2fe51c15e3aac390d) and have the path in there only twice ;).
  2. I looked at the mentioned https://github.com/PowerShell/PowerShell/issues/6211#issuecomment-367477137 but could not figure out why this was needed before. Either way, it is recommended to use ContainerUser over ContainerAdministrator and the image works just fine if this line is dropped (f4b2646e4b97ff5891a31c654913f089b968519d).
  3. As far as I know, the SHELL directive only affects Dockerfile commands using shell syntax. Seeing as there are none in this Dockerfile, the directive can be dropped (bcdd1728a83732680c620d4829a2cc7e050fdfb8).
  4. Finally, using unix paths gets rid of some escaping and makes paths easier to read (bfd80b0ffd8088319b66f4461394b2a95c515607).

julmb avatar Oct 15 '21 13:10 julmb