Testcontainers-java: Windows testing

Created on 18 Jan 2018  路  11Comments  路  Source: testcontainers/testcontainers-java

We should consider different options for a Windows CI environment because ATM we only test it manually

cliendocker-for-windows cliendocker-machine help wanted owindows resolutioacknowledged typhousekeeping

Most helpful comment

We are currently working on a Windows CI environment in TeamCity.

All 11 comments

Try https://www.appveyor.com/
It's free for open-source projects and works with Maven.

Hey @AnkBurov, thanks for the suggestion. We've already looked into appveyor a couple of time, but currently they aren't supporting Linux Containers (LCOW). Once the provided Windows images will support LCOW and WCOW simultaneously, this might be a good solution.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

We are currently working on a Windows CI environment in TeamCity.

AppVeyor has LCOW support now:
https://www.appveyor.com/blog/2019/10/11/vs2019-image-with-docker-wsl-preheated/

However, I would like to add that upon preliminary testing, the version of LCOW that AppVeyor is using seems different from the version of LCOW that docker has supported since 2016.

The reason I say this is that, on my Windows desktop (running Linux containers), I could mount //var/run/docker.sock:/var/run/docker.sock (just like how you do it in linux), Ryuk will run, and all of my tests run.

However, when pushed to AppVeyor (using their LCOW), they complain that //var/run/docker.sock is an invalid mount path. In the build details, you can see the docker info (using lcow) and the exact error thrown. https://ci.appveyor.com/project/isen-ng/testcontainers-dotnet/builds/28955746

I have not had time to investigate further, but I believe this is the issue:
https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/linux-containers

I highly suspect that I am using LCOW with LinuxKit, while AppVeyor is using LCOW with Hyper-V (or vice-versa). And both are valid use-cases. I need find a way to detect this, and apply the correct config/mounts.

If this hypothesis turns out to be true, this means that AppVeyor can run CI to test LCOW with Hyper-V but there are still no tests for LCOW with LinuxKit.

I have confirmed this behavior with further testing.

AppVeyor's LCOW support uses the experimental feature described in https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/linux-containers

The problem with this experimental feature is that it is incomplete, meaning there is no way to mount /var/run/docker.sock into Ryuk.

Running a pure linux command gives the expected exception

$ docker run --rm -v //var/run/docker.sock:/var/run/docker.sock quay.io/testcontainers/ryuk:0.2.3
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: invalid volume specification: '//var/run/docker.sock:/var/run/docker.sock'.

Running the windows command gives another exception

$ docker run --rm -v //./pipe/docker_engine:/var/run/docker.sock quay.io/testcontainers/ryuk:0.2.3
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: invalid volume specification: '//./pipe/docker_engine:/var/run/docker.sock': invalid mount config for type "npipe": Linux containers on Windows do not support named pipe mounts.

This current problem is discussed in https://github.com/moby/moby/issues/36574

Essentially, the new experimental LCOW does not support docker in docker and cannot be used to run Ryuk and TestContainers in most cases.

Now, I just need to find a CI that runs the regular LCOW on Windows.

P.S. In any case, the experimental LCOW requires a new flag --platform which most Docker API implementations do not support yet.

FTR we do test every master build on Windows, and some PRs when needed

Ohhh! you have your own Windows VM with linux containers!

Well, it is not even a VM, but a mini Dell OptiPlex hosted at my place 馃槀

This is what I call, dedication. Up till now, I cannot find a Win10 (with GUI) ci solution for free yet.

Was this page helpful?
0 / 5 - 0 ratings