-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Windows containers #8436
base: main
Are you sure you want to change the base?
Conversation
A WCOW compatible image of https://github.com/testcontainers/helloworld is required for the ResourceReaperTest to succeed on Windows containers. |
@@ -31,7 +31,7 @@ class RyukResourceReaper extends ResourceReaper { | |||
.withConstantThroughput() | |||
.build(); | |||
|
|||
private final AtomicBoolean started = new AtomicBoolean(false); | |||
private static final AtomicBoolean started = new AtomicBoolean(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -210,6 +212,8 @@ public void close() { | |||
Version version = client.versionCmd().exec(); | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, yes, but I'll check later to ensure we have correct assumptions here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.