Open jtnord opened 1 year ago
Alas the flags -SwitchDaemon
(etc.) are Docker Desktop only si it's not an option today on the Jenkins Infrastrcuture which uses Windows Server VMs.
As per https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment, Docker Desktop is recommended on Windows 10/11 and Docker CE standalone (or Mirantis or containerd) on Windows Server 2016/2019/2022.
It means that, in order to cover the CI case of "Windows build with Linux container", we need to use one of the following solutions:
Define a new kind of VM with a Windows 11 + Docker Desktop to replace existing Windows images
jenkins
switching from/to Linux ContainerDefine a new kind of VM with a Windows 11 + Docker Desktop to next to existing Windows images
jenkins
switching from/to Linux Container(if it works: nested virtualization is to be checked) Define a new kind of VM with a Windows Server + WSL (to provide Docker containers) next to existing Windows images
if you have any other idea, please share!
Tried a manual installation of Docker Desktop on a Windows 2022 (full, not a "core") server: succeeded with the UI enabled but I failed to have Docker Linux containers working.
Gotta try with WSL preinstalled and initialized before Docker Desktop.
going to backlog as no emergency here
Service(s)
ci.jenkins.io
Summary
It is not uncommon for a plugin to have some containers for tests and use the legacy
docker-fixtures
orTestContainers
However the containers are generally linux specific (e.g.
--platform=linux
) and this causes build errors when run on windows VMs.As it is useful to run the tests on Windows as well as Linux it would be helpful if there was a Windows VM that had been set to Linux containers (rather than the current Linux containers).
Current workaround is to use a specific container label in the
buildPlugins
(which actually broke and was just fixed a few hours ago)e.g. https://github.com/jenkinsci/distfork-plugin/blob/master/Jenkinsfile https://github.com/jenkinsci/docker-workflow-plugin/blob/d5d2e5c4007f7ea006152542b2bcbe0f1b2b08aa/Jenkinsfile#L1-L4 are 2 plugins that use this approach.
a windows VM can be switched between linux and windows containers with the command
"c:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon
untested (the help is broken) but
-SwitchLinuxEngine
may switch specifically to linux and-SwitchWindowsEngine
may likewise do the same for windows containers.Reproduction steps
No response