Windows Docker API issue for using GitLab-runner
NickName:StarShine Ask DateTime:2018-09-12T21:51:29

Windows Docker API issue for using GitLab-runner

While setting up a Windows CI pipeline from GitLab, I was going through the numerous issues related to the Windows gitlab-runner docker executor that is using an old API (1.18) which Docker no longer accepts.

The issue results in the following error messages when the Gitlab/CI tries to connect to the runner:

Running with gitlab-runner 11.2.0 (35e8515d) on Windows VS2017 x64 0825d1d7 
Using Docker executor with image buildtools2017 ... 
ERROR: Preparation failed: Error response from daemon: **client version 1.18 is too old.** Minimum supported API version is 1.24, please upgrade your client to a newer version (executor_docker.go:1148:0s)

The 'buildtools2017' docker image that is referred to is the Microsoft "official".

The image seems to be working and valid for the current (experimental) Docker version I'm using (18.06.1-ce-win74) and for the stable version as well.

The issue was described throughout the GitLab wiki. Andrew Leech (?) went so far as to fork and modify the runner so that it would connect properly, and kindly provided his scripts and comments in a blogpost. This seems to give some results:

C:\gitlab-runner>gitlab-runner.exe -v
Version:      10.8.0~beta.551.g67a6ccc7
Git revision: 67a6ccc7
Git branch:   windows-container-executor
GO version:   go1.9.4
Built:        2018-07-30T08:57:44+00:00
OS/Arch:      windows/amd64

The GitLab wiki states that they're waiting until a more stable solution can be released. Currently it's been over one year of broken windows docker runners..

Andrew's blogpost and a link to his gitlab-runner.exe describes actually a different workaround using the PowerShell runner that then starts a Docker instance. All the token info is exposed, I'm not sure how to set it up, and it also seems to rely on an external image with older build tools.

It seems the docker runner now connects, but if I undestand correctly, the Gitlab-runner docker runner does not seem to agree on the 'build directory' that is used. The first Gitlab/CI scriptline in my repo is just an echo command, so the error is not about the ci script content, but I'm not sure what it IS about. If anyone with docker fu knows what is going on this would really help me.

Using Docker executor with image buildtools2017 ...
ERROR: Preparation failed: build directory needs to be absolute and non-root path

Cheers,

Copyright Notice:Content Author:「StarShine」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/52296826/windows-docker-api-issue-for-using-gitlab-runner

More about “Windows Docker API issue for using GitLab-runner” related questions

Windows Docker API issue for using GitLab-runner

While setting up a Windows CI pipeline from GitLab, I was going through the numerous issues related to the Windows gitlab-runner docker executor that is using an old API (1.18) which Docker no longer

Show Detail

gitlab-runner on windows in docker fails to run with wrong OSType error

I have a gitlab-runner on a Windows Server with enabled Hyper-V. With the docker API exposed to the network I'm able to run linux docker containers and even docker itself with docker:latest. e:\...

Show Detail

Gitlab-runner + Docker + Windows - Invalid volume specification

I'm trying to run my Gitlab CI locally using Gitlab-runner and docker before committing to make sure they work okay. But I'm having some strange issues! Unfortunately I have no choice but to use w...

Show Detail

register gitlab-runner to gitlab from docker

i am new to docker. i run gitlab ce container with this command: docker run --detach --hostname localhost --publish 443:443 --publish 80:80 --name gitlab --restart always gitlab/gitlab-ce:latest ...

Show Detail

Cache location with gitlab-runner and docker executor on Windows?

Where are the zips of the job caches when running gitlab-runner on Windows with docker executor ?

Show Detail

Gitlab in docker on windows

I want to run Gitlab using docker on windows 10, but cannot access the service. I am using docker composer with the configuration file version: '3.6' services: web: image: 'gitlab/gitlab-ce' ...

Show Detail

Do I need to install Docker to install a gitlab-runner in windows?

Can't install gitlab-runner through windows. When running the command gitlab-runner install, I am getting this error- The term 'gitlab-runner' is not recognized as the name of a cmdlet, fu...

Show Detail

Using Gitlab-Runner for Windows on GitLab CI Pipeline with Docker Desktop

I would like to run my Gitlab-CI Pipeline in a Windows environment. Therefore, I use a Windows Gitlab-Runner which uses Docker Desktop version 4.3.0 as executor. The "Server", on which the

Show Detail

Install CI gitlab with Docker in Windows

Trying to install a gitlab runner on my windows machine inside a docker container Using docker run -d --name gitlab-runner --restart always \ -v ${PWD}/gitla /gitlab-runner \ -v /var/run/

Show Detail

Issue commands from a gitlab-runner inside docker container

I have a machine with multiple docker containers for a project that I am developing and I just set up a new docker container running Gitlab-Runner inside it. I need to run a few commands on all the...

Show Detail