Volume Maintenance fails with Docker Version 29

Summary

With Docker version 29 the clear-docker-cache command runs on an error as the Docker Engine stopped supporting API Version 1.41. The calling API version is set manually in the clear-docker-cache script for some reason.

Steps to reproduce

Update docker-ce to version 29. Run "/usr/share/gitlab-runner/clear-docker-cache prune-volumes"

Actual behavior

root@dev026:~# /usr/share/gitlab-runner/clear-docker-cache prune-volumes

Check and remove all unused containers (both dangling and unreferenced) including volumes.
------------------------------------------------------------------------------------------
Error response from daemon: client version 1.41 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version

Expected behavior

Volumes are pruned

Environment description

Self-hosted runners

root@dev026:~# docker version --format '{{.Client.APIVersion}}'
1.52
root@dev026:~# docker version --format '{{.Client.Version}}'
29.0.0
root@dev026:~# dpkg -l | grep docker
ii  docker-buildx-plugin                   0.29.1-1~ubuntu.22.04~jammy             amd64        Docker Buildx plugin extends build capabilities with BuildKit.
ii  docker-ce                              5:29.0.0-1~ubuntu.22.04~jammy           amd64        Docker: the open-source application container engine
ii  docker-ce-cli                          5:29.0.0-1~ubuntu.22.04~jammy           amd64        Docker CLI: the open-source application container engine
ii  docker-ce-rootless-extras              5:29.0.0-1~ubuntu.22.04~jammy           amd64        Rootless support for Docker.
ii  docker-compose-plugin                  2.40.3-1~ubuntu.22.04~jammy             amd64        Docker Compose (V2) plugin for the Docker CLI.
root@dev026:~#

Used GitLab Runner version

root@dev026:~# gitlab-runner --version
Version:      18.5.0
Git revision: bda84871
Git branch:   18-5-stable
GO version:   go1.24.6 X:cacheprog
Built:        2025-10-13T19:20:30Z
OS/Arch:      linux/amd64
root@dev026:~#

Possible fixes

Check https://docs.docker.com/engine/release-notes/29/#breaking-changes - API Version 1.44 is now required

Unpin the api version 1.41 in script clear-docker-cache:

https://gitlab.com/gitlab-org/gitlab-runner/-/blob/v18.5.0/packaging/root/usr/share/gitlab-runner/clear-docker-cache?ref_type=tags#L41

https://gitlab.com/gitlab-org/gitlab-runner/-/blob/v18.5.0/packaging/root/usr/share/gitlab-runner/clear-docker-cache?ref_type=tags#L65