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

Windows 2022 Dockerfile

Open cduchenoy opened this issue 10 months ago • 8 comments

Fix issue: #187

cduchenoy avatar Jan 23 '25 15:01 cduchenoy

Thanks, maybe we can mention this somewhere?

And I think @6543, you were the one mostly pushing windows support in the past? Maybe you can check this out?

qwerty287 avatar Jan 24 '25 13:01 qwerty287

RUN commands should be merged together to minimize layer count

lafriks avatar Feb 02 '25 19:02 lafriks

Hi,

Before making any optimizations, I would like to know if there is a desire to integrate Windows support officially into Woodpecker.

I think we could make a windows-base image with Git support only which would allow us to use buildx support on Linux to copy the Windows executable from the official pipeline.

We can build a Windows image from a Linux OS if we only use COPY in the Dockerfile

FROM woodpeckerci/base:windows-ltsc2022-amd64
USER ContainerAdministrator
...
COPY --from=build src/release/plugin-git.exe /bin/

USER ContainerUser
....
ENTRYPOINT ["C:\\bin\\plugin-git.exe"]

cduchenoy avatar Feb 03 '25 09:02 cduchenoy

Sure, just added a comment to not forget that

lafriks avatar Feb 03 '25 20:02 lafriks

FYI, we use this image successfully for a number of projects.

It is worth switching to the latest version of git for windows: this contains git lfs v3.7.0, which contains a patch for using netrc on windows (which I actually made for using this plugin on windows).

https://github.com/git-for-windows/git/releases/tag/v2.50.0.windows.2 https://github.com/git-lfs/git-lfs/releases/tag/v3.7.0

johanvdw avatar Jul 04 '25 21:07 johanvdw

It seems this is working for multiple people, so I guess we can try to officially support it.

However, we need to be able to make sure that this is maintained. As none of us woodpecker maintainers will use this afaik, you would have to take care of this. We do this similar for the bitbucket datacenter support in the core project. If anybody complains about something with this dockerfile, we would ping and mention you and expect that you fix the issues.

I can try to give this a review but if there's somebody with more experience and knowledge of windows docker that would be very good as well.

qwerty287 avatar Jul 05 '25 06:07 qwerty287

And I think @6543, you were the one mostly pushing windows support in the past? Maybe you can check this out?

me: windows + local exec

windows containers are hard to maintain as you have to target each windows kernel version as different platform ... :/

6543 avatar Oct 10 '25 10:10 6543

We can build a Windows image from a Linux OS if we only use COPY in the Dockerfile

not a bad idea ... we just need good source of the base image for the most common windows kernels currently out there

6543 avatar Oct 10 '25 10:10 6543