GitLab Runner with docker-autoscaler not reusing available cache volumes

Thank you for your input!

I’m not sure my question is completely on topic with the linked ticket. I can try, but I might have to create a separate ticket for that.

Unfortunately I cannot use the clear-docker-cache script you mentioned as this is only available in the docker container where the gitlab runner is, not in the separate instances which are create by the runner.
That’s also why I am hesitant to add a comment to these tickets as they are mainly concerned with the docker executor which is only one machine and not the fleet with docker-autoscaler or docker+machine.

Now I either have to create a separate image for the single VMs, which contains a cron job cleaning the volumes after a while (which can still fail if a lot of very short jobs are run) or start every job with a pre_get_sources_script: where I’m calling docker volume prune -af. This also requires a modification to the helper image.

Besides, my main concern is why the docker volumes are actually not re-used, not how I can get rid of them.

Both are not really a good solution as they still leave some possibilities for failure. As it stands now I have to go back to docker+machine, which will no longer be supported at the end of the year.