myoung34 / docker-github-actions-runner

This will run the new self-hosted github actions runners with docker-in-docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need for privileged mode prevents use on Azure Containers

davetapley opened this issue · comments

This is more an FYI to help others, but might be worth noting in the README?

I was hoping I could use this with Azure Containers, but :

Azure Container Instances does not expose direct access to the underlying infrastructure that hosts container groups. This includes access to the Docker API running on the container's host and running privileged containers.

https://docs.microsoft.com/en-us/azure/container-instances/container-instances-troubleshooting#cannot-connect-to-underlying-docker-api-or-run-privileged-containers


So as far as I can tell, that's a dead end? 🚫

You should still be able to run it. you just cant mount the docker socket or use privileged mode

Correct, it starts up and registers just fine, but then blows up:

Build container for action use: '/_work/_actions/aliencube/microsoft-teams-actions/v0.8.0/Dockerfile'.
  /usr/bin/docker build -t c3f261:4c67d9981f784294998ff45f24b63eb9 -f "/_work/_actions/aliencube/microsoft-teams-actions/v0.8.0/Dockerfile" "/_work/_actions/aliencube/microsoft-teams-actions/v0.8.0"
  time="2021-09-22T01:57:02Z" level=error msg="failed to dial gRPC: cannot connect to the Docker daemon. Is 'docker daemon' running on this host?: dial unix /var/run/docker.sock: connect: no such file or directory"
  time="2021-09-22T01:57:02Z" level=error msg="Can't add file /_work/_actions/aliencube/microsoft-teams-actions/v0.8.0/.gitignore to tar: io: read/write on closed pipe"
 ...

I guess it would work if the workflow only contained run and no uses? 🤔

I'm not sure, but it might be a question for the upstream runners. This project is working correctly

I'm happy to accept a PR that explains the issue if you get an official answer, however

@myoung34 aha, so I think this is happening because the action is a Docker container action, i.e. its action.yml contains:

runs:
  using: docker

I don't know if this can be worked around with some Docker-on-Docker magic, and/or whether that would be appropriate for this project?

Im not sure tbh. Anything with DinD is unsupported until the upstream feature is supported