Label docker volumes created by Runner
Overview
For each resource that we create for the Docker executor inside of the Docker daemon we add labels this makes it easy for an automation tool to filter by those labels and make it easier to identify which resources the Runner is creating inside of the Docker daemon. At the moment these labels aren't attached to the volumes that we create for the Jobs, so users/tools can't filter with labels.
For example:
$ docker volume inspect runner-retrydoc-project-0-concurrent-0-cache-c33bcaa1fd2c77edfc3893b41966cea8
[
{
"CreatedAt": "2020-04-07T07:54:53Z",
"Driver": "local",
"Labels": null, # <---- Empty
"Mountpoint": "/var/lib/docker/volumes/runner-retrydoc-project-0-concurrent-0-cache-c33bcaa1fd2c77edfc3893b41966cea8/_data",
"Name": "runner-retrydoc-project-0-concurrent-0-cache-c33bcaa1fd2c77edfc3893b41966cea8",
"Options": null,
"Scope": "local"
}
]
Proposal
For each volumes that the Runner creates, we should attach the same kind of labels we add to the build/predefined containers to be consistent. There is already the same kind of work being done for networks