I am using shared Gitlab runners to build a docker images using dind, see pipeline below. I was using this pipeline for more than two years without any issues.
.buildDocker:
stage: build-docker
only:
- master
image: docker
services:
- docker:dind
before_script:
- docker login -u gitlab-ci-token -p $CI_ACCESS_TOKEN registry.gitlab.com
script:
- docker pull $CI_REGISTRY_IMAGE:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:${CI_COMMIT_SHA:0:12} -t $CI_REGISTRY_IMAGE:latest -f Dockerfile .
- docker push $CI_REGISTRY_IMAGE:${CI_COMMIT_SHA:0:12}
- docker push $CI_REGISTRY_IMAGE:latest
However today the pipeline stopped working (yesterday it worked), error:
$ docker pull $CI_REGISTRY_IMAGE:latest || true
Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running?
$ docker build --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:${CI_COMMIT_SHA:0:12} -t $CI_REGISTRY_IMAGE:latest -f Dockerfile .
Cannot connect to the Docker daemon at tcp://docker:2375. Is the docker daemon running?
I have discovered, that gitlab runner version changed from 16.6.0~beta.105.gd2263193
to 16.8.0~beta.67.gb5664e8e
There is also a warning, that did not appear in previous version:
*** WARNING: Service runner-ns46nmmj-project-46375469-concurrent-0-3fdfe577c431c0a2-docker-0 probably didn't start properly.
Health check error:
create service container: "specify container image platform" requires API version 1.41, but the Docker daemon API version is 1.40 (services.go:192:0s)
Service container logs:
2024-01-18T13:46:25.311174781Z cat: can't open '/proc/net/arp_tables_names': No such file or directory
2024-01-18T13:46:25.313622556Z ip: can't find device 'nf_tables'
2024-01-18T13:46:25.314617549Z modprobe: can't change directory to '/lib/modules': No such file or directory
*********
Does anyone have similar issue?
How to fix this?
Tried approaches (that did not work)
- changed image to order
image: docker:20.10.16
and service todocker:20.10.16-dind
- tried latest tag
docker:24
anddocker:24-dind