When starting a new github runner in a virtualized environment I had some issues due to the environment using Server Core 2019 and therefore not shipping with the usual GUI tools. To use the runner with the Docker service by default I had to register the Github agent runner as the LocalSystem account instead.
- Download and install Docker and Git per their docs
- In your Github repo, go to the settings > actions section and click add runner. Select Windows (if it's not default) then download the agent and expand it per the instructions.
- Ensure you use --windowslogonaccount LocalSystem
./config.cmd --url repourl --token token --runasservice --name hostname --windowslogonaccount LocalSystem
The reason this works is that by default the LocalSystem user has access to Docker although it also has access to slews of other resources. It is probably better practice to make a user specifically for your runners with just the access they need but this is difficult on Server Core so I just close things out