Is it possible to use Docker runners on Windows Server 2016?

Hi,

I’m trying to figure out if I can use GitLab CI with docker runners to build .NET applications using MSBuild, but I haven’t had much luck. For now, I’ve been testing with Windows Server (Core) 2016 and the windowsserver core docker image. A summary of what I’ve done so far:

  • Install a Windows Server (Core) 2016 evaluation (as the host) in a virtual machine.
  • Enable RDP on the host.
  • Install Docker using a mix of the instructions here and here.
  • Install GitLab CI Multi Runner.
  • Register a runner. This doesn’t seem to work via Remote PowerShell. It works when using RDP.
  • Configure the host to use TCP instead of sockets. The Prepare Container Host section of these instructions gives and idea of what I’ve done.
  • Configure the runner to communicate with the host via TCP. It’s the host parameter of the runners.docker config described here. Note, the Windows firewall on the host needs to allow the traffic.
  • Run the windowsservercore image, configure it, and commit it as a new image.

At that point, I tried to use the image. I ended up with an error about needing the xz command. I doubt it’s the correct way of doing things, but I can get past the error by manually installing xz for Windows.

Then I run into an error that I can’t figure out how to deal with:

Using Docker executor with image ryan/msbuild:1 ...
ERROR: Failed to create container volume for /builds/examples API error (500): re-exec error: exit status 1: output: link \\?\C:\ProgramData\docker\windowsfilter\2e40e03daf7fb5685468c4a25e1a683ac350ca87068f013f00407fa6e2de3aae\usr\share\terminfo\2\2621 \\?\C:\ProgramData\docker\windowsfilter\2e40e03daf7fb5685468c4a25e1a683ac350ca87068f013f00407fa6e2de3aae\usr\share\terminfo\2\2621a: Cannot create a file when that file already exists.

ERROR: Preparation failed: API error (500): re-exec error: exit status 1: output: link \\?\C:\ProgramData\docker\windowsfilter\2e40e03daf7fb5685468c4a25e1a683ac350ca87068f013f00407fa6e2de3aae\usr\share\terminfo\2\2621 \\?\C:\ProgramData\docker\windowsfilter\2e40e03daf7fb5685468c4a25e1a683ac350ca87068f013f00407fa6e2de3aae\usr\share\terminfo\2\2621a: Cannot create a file when that file already exists.

I’m fairly sure that’s an error from the multi runner since I can run the image by hand without issue. However, I’m not sure if it’s caused by a configuration problem, missing dependencies, or a bug. Any ideas?

I’m hoping to use a docker runner with the windowsservercore image to build a Universal Windows Platform application. I’m only evaluating UWP, so my requirements are fairly flexible. I’d be open to alternate approaches / suggestions.

Also, GitLab CI Multi Runner seems to rely on running Linux shell scripts. Is there an expectation of having the Windows Subsystem for Linux available? The WSL is not usable on Windows Server. I’d be willing to force install it, at least for testing, if someone knows how.

1 Like

Hi @ryan,

Did you get it to work? I’m currently figuring out all the stuff to get my test project up and running. I’m facing the same issues now.

@Paul-dH. No, I wasn’t able to get it working. I have this issue bookmarked. If I remember correctly there were a few other issues that looked similar / related, but I don’t have links handy and don’t see a way to get a list of my subscribed issues.

I’ll post here if I make any progress, but it’s unlikely I’ll end up looking at this again for a while. My plan was to get things working using a shell executor to start with, but I never got back to it.

@ryan There seem to be many issues at the moment with the runner on Windows, there is a good link in the issue you mentioned from Microsoft. But it’s Linux specific: Technet

I don’t think a Windows based runner using Docker executors is supported. The most promising issue I’ve seen is this one. There’s also this issue and this issue and this issue. Using Docker on Windows you might run into this issue too.

1 Like