plugin-git
plugin-git copied to clipboard
Windows 2022 Dockerfile
Fix issue: #187
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?
RUN commands should be merged together to minimize layer count
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"]
Sure, just added a comment to not forget that
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
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.
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 ... :/
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