Windows runner network problems
As mentioned in the support forum (https://forum.gitlab.com/t/docker-containers-on-shared-windows-runners-lost-internet-connection/92388/3) the gitlab windows runner does not provide correct network access for docker containers any more.
Steps to reproduce:
.gitlab-ci.yaml
test-runner:
stage: build
tags: [ windows ]
before_script:
- Start-Service -Name "docker"
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker run mcr.microsoft.com/dotnet/sdk:6.0-windowsservercore-ltsc2019 curl https://api.nuget.org/v3/index.json
Result in Log-File:
[0KRunning with gitlab-runner 15.8.2 (4d1ca121)[0;m
[0K on windows-shared-runners-manager 6QgxEPvR, system ID: s_1a31f6141cb7[0;m
section_start:1694781452:resolve_secrets
[0K[0K[36;1mResolving secrets[0;m[0;m
section_end:1694781452:resolve_secrets
[0Ksection_start:1694781452:prepare_executor
[0K[0K[36;1mPreparing the "custom" executor[0;m[0;m
[0KUsing Custom executor with driver autoscaler 0.1.3 (4f53eb0)...[0;m
Creating virtual machine for the job...
Virtual machine created!
section_end:1694781646:prepare_executor
[0Ksection_start:1694781646:prepare_script
[0K[0K[36;1mPreparing environment[0;m[0;m
Running on PACKER-6453DA2E via
runner-wsrm-5099216611...
section_end:1694781660:prepare_script
[0Ksection_start:1694781660:get_sources
[0K[0K[36;1mGetting source from Git repository[0;m[0;m
[32;1mFetching changes with git depth set to 20...[0;m
Initialized empty Git repository in C:/GitLab-Runner/builds/msh-gmbh/topas/support/docker/.git/
[32;1mCreated fresh repository.[0;m
[32;1mChecking out 821d9c77 as story/bug_report...[0;m
git-lfs/2.8.0 (GitHub; windows amd64; go 1.12.2; git 30af66bb)
[32;1mSkipping Git submodules setup[0;m
section_end:1694781676:get_sources
[0Ksection_start:1694781676:step_script
[0K[0K[36;1mExecuting "step_script" stage of the job script[0;m[0;m
[0;33mWARNING: Starting with version 14.0 the 'build_script' stage will be replaced with 'step_script': https://gitlab.com/gitlab-org/gitlab-runner/-/issues/26426[0;m
[32;1m$ Start-Service -Name "docker"[0;m
[32;1m$ docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY[0;m
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded
[32;1m$ docker run mcr.microsoft.com/dotnet/sdk:6.0-windowsservercore-ltsc2019 curl https://api.nuget.org/v3/index.json[0;m
WARNING! Your password will be stored unencrypted in C:\Users\gitlab_runner\.docker\config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Unable to find image 'mcr.microsoft.com/dotnet/sdk:6.0-windowsservercore-ltsc2019' locally
6.0-windowsservercore-ltsc2019: Pulling from dotnet/sdk
c9226d61d3bd: Pulling fs layer
179757339e05: Pulling fs layer
f2fcd491892b: Pulling fs layer
920f2fdaeaf7: Pulling fs layer
580123635e2b: Pulling fs layer
52463278d7ea: Pulling fs layer
caf861dce9b0: Pulling fs layer
d8bca0749059: Pulling fs layer
68fbd32ea248: Pulling fs layer
b06f3514036e: Pulling fs layer
6ca26a7ee4ae: Pulling fs layer
920f2fdaeaf7: Waiting
580123635e2b: Waiting
52463278d7ea: Waiting
caf861dce9b0: Waiting
d8bca0749059: Waiting
68fbd32ea248: Waiting
b06f3514036e: Waiting
6ca26a7ee4ae: Waiting
f2fcd491892b: Verifying Checksum
f2fcd491892b: Download complete
920f2fdaeaf7: Verifying Checksum
920f2fdaeaf7: Download complete
580123635e2b: Verifying Checksum
580123635e2b: Download complete
52463278d7ea: Verifying Checksum
52463278d7ea: Download complete
179757339e05: Verifying Checksum
179757339e05: Download complete
caf861dce9b0: Verifying Checksum
caf861dce9b0: Download complete
d8bca0749059: Verifying Checksum
d8bca0749059: Download complete
b06f3514036e: Verifying Checksum
b06f3514036e: Download complete
6ca26a7ee4ae: Verifying Checksum
6ca26a7ee4ae: Download complete
68fbd32ea248: Verifying Checksum
68fbd32ea248: Download complete
c9226d61d3bd: Verifying Checksum
c9226d61d3bd: Download complete
c9226d61d3bd: Pull complete
179757339e05: Pull complete
f2fcd491892b: Pull complete
920f2fdaeaf7: Pull complete
580123635e2b: Pull complete
52463278d7ea: Pull complete
caf861dce9b0: Pull complete
d8bca0749059: Pull complete
68fbd32ea248: Pull complete
b06f3514036e: Pull complete
6ca26a7ee4ae: Pull complete
Digest: sha256:c57e692b3249a72cd51166c425977f071a691469be9556400e74e4e48a5c4436
Status: Downloaded newer image for mcr.microsoft.com/dotnet/sdk:6.0-windowsservercore-ltsc2019
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:06 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:07 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:08 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:09 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:10 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:11 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:12 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:13 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:14 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:15 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:16 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:17 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:18 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:19 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:20 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:21 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:22 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:23 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:23 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:24 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:26 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:27 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:28 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:29 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:30 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:31 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:32 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:32 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:33 --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- 0:00:35 --:--:-- 0curl: (6) Could not resolve host: api.nuget.org
section_end:1694782368:step_script
[0Ksection_start:1694782368:cleanup_file_variables
[0K[0K[36;1mCleaning up project directory and file based variables[0;m[0;m
section_end:1694782376:cleanup_file_variables
[0K[31;1mERROR: Job failed: exit status 1
[0;m
The docker container is not able to resolve the host:
Could not resolve host