Add support for Windows containers#8436
Add support for Windows containers#8436gesellix wants to merge 5 commits intotestcontainers:mainfrom
Conversation
|
A WCOW compatible image of https://github.com/testcontainers/helloworld is required for the ResourceReaperTest to succeed on Windows containers. |
| .build(); | ||
|
|
||
| private final AtomicBoolean started = new AtomicBoolean(false); | ||
| private static final AtomicBoolean started = new AtomicBoolean(false); |
There was a problem hiding this comment.
This one was required to make the ResourceReaperTest succeed. I don't understand, why it fails or why it didn't fail before.
Now as pull request prepared at testcontainers/helloworld#5 |
| log.debug("Docker version: {}", version.getRawValues()); | ||
| activeApiVersion = version.getApiVersion(); | ||
| String osType = dockerInfo.getOsType(); | ||
| runningWindowsContainers = StringUtils.isNotBlank(osType) && osType.equals("windows"); |
There was a problem hiding this comment.
Is this really enough to identify WCOW? Meaning with Docker Desktop on Windows with WSL2 backend, it would return linux here?
There was a problem hiding this comment.
AFAIK, yes, but I'll check later to ensure we have correct assumptions here.
There was a problem hiding this comment.
Here are both variants, using Docker Desktop on Windows 11, WSL2 enabled (not Hyper-V):
λ "c:\Program Files\Docker\Docker\DockerCli.exe" -SwitchLinuxEngine
λ docker info --format "{{json .OSType }}"
"linux"
λ "c:\Program Files\Docker\Docker\DockerCli.exe" -SwitchWindowsEngine
λ docker info --format "{{json .OSType }}"
"windows"…'t work on Windows, yet. See the InternalCommandPortListeningCheck.
Following the release of Ryuk 0.7.0, this adds basic support for Windows containers as a first step for #5621.
The behaviour on Linux and macOS should not be changed in any way, and Windows support depends on the daemon reporting a "windows" operating system.