You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the enhancement
Is it possible for you to provide official docker images for letting a runner run?
Additional information
We want to use self hosted runner, but we dont want to maintain machines/vms so it would be cool to have a ready to run official docker image in order to use them in services like aws fargate/azure container instances.
If im wrong here and I should have opened a topic in the github actions community forum please let me know and feel free to close the issue/feature request.
Reacted by Vincent Brison, Lukas, Jonas Strassel, Lars Hvam, David J. M. Karlsen, Logan Stuart, Ryan Peck, Jhonn Frazão, t3mi, arash-bizcover and 130 more
Reacted by Vincent Brison, David J. M. Karlsen, Lukas, Antoine Roy-Gobeil, Paolo Angioletti, DJ Carpenter, Maciej Pijanowski, Robert W, Fabio Ivona, vsisl and 4 more
thrownewNotSupportedException("Container feature is not supported when runner is already running inside container.");
This is a major downside, as we can not yet manage self hosted runners with Kubernetes for example, as we have to manage VMs or real machines.
Reacted by Manuel, João Magalhães, Yutaka Matsubara, Daniel Klevebring, Marshall An, Oleg Kainov, Fabrizio Sabatini, Alexander Karkossa, Eddie Schneider, Ville Saukkonen and 28 more
Thank you @vincentbrison for providing these examples, I found a couple of them as well, but I am not sure if we are allowed to use them in our company (we have a restriction to use only official images). Thats the reason why I asked here. :)
The hint about docker in docker is useful (a couple of application suffer of this problem). 👍
I don't understand this limitation, what's the difference between this and a VM running in the machine? We are using M1 machines as our hosts and since the native runner on macOS does not support containers, we decided to use Docker, but when executing it, we get this error.
Reacted by John Steel, Sung-Jae Lee, Helio Machado, Jooho Lee, Milan Dufek, Fontany--Legall Brandon, Dominik and Aaron Manning
Also its possible with docker to run a docker conatiner in a docker container.
You only need to mount the docker directory /var/lib/docker in the normal file system so it doesnt gets mounted as an AUFS mountpoint.
There is a bare-minimum runner image available now: ghcr.io/actions/actions-runner:latest
The Dockerfile is available here.
It is now part of the release process (#2250). The idea is to provide an image that can be used by actions-runner-controller, but also as a stand-alone image.
Reacted by Minoru Mizutani, Milan Dufek, dlicois, Manuel, John Molakvoæ, Luke Nelson, Saulius Menkevičius, Mon, ukewea, Gera and 1 more
Reacted by Asım Tahir, Nick Graef, Mon, Mikhail Nacharov and Manuel
You would need to provide an entrypoint. Keep in mind, the entrypoint should know how to configure and run the runner. The entrypoint by default does not exist. So imperatively, you can provide an --entrypoint with docker run, or you can use this Dockerfile as a base for building your own minimal runner image.
Hi @nikola-jokic - thanks for providing those Dockerfiles - is there any plans to support docker in docker? We're in the process of migrating from Gitlab CI/CD to Github Actions and it seems quite agressive to run autoscaling VMs compared to running 1-2 dedicated machines that runs 5-10 instances (that are ephemeral) of that container.
Either being able to use docker-in-docker, or having the agent support multiple workspaces on the same VM would both solve this.
@nikola-jokic - I'm afraid I am not entirely following - could you elaborate on what needs to be done for the entry point? If I understand this right, by using the dockerfile you link to we can create our own images to set up runners and manage these?
For anyone stumbling upon this in future, this one command should be enough. Just replace the URL and token.
❯ docker run -it ghcr.io/actions/actions-runner:2.314.1 sh -c './config.sh --url https://github.com/<user or org>/<repo> --token <token> --unattended && ./run.sh'
(use docker run -d instead of docker run -it to run in the background)
Reacted by Louis, Meysam, Duncan Hoggan, Shane da Silva, Dmitry Romanenko, Arend-Jan van Hilten, Angelos Bouklis, Raphael, dniald, Philipp Auch and 3 more
Reacted by Dennis Staiger, Avram Djordjevic, Paweł Kozubal, ottah, Justin Bennett, tanov25, Joe Scharf, Gera, Tim Riedl, Per-Arne Andersen and 1 more
Activity
vincentbrison commentedon Mar 11, 2020
Some example of runner as a Docker image:
Additionally, Runner running in Docker is not able to use Docker itself:
runner/src/Runner.Worker/ContainerOperationProvider.cs
Line 68 in f9b5d62
This is a major downside, as we can not yet manage self hosted runners with Kubernetes for example, as we have to manage VMs or real machines.
WtfJoke commentedon Mar 13, 2020
Thank you @vincentbrison for providing these examples, I found a couple of them as well, but I am not sure if we are allowed to use them in our company (we have a restriction to use only official images). Thats the reason why I asked here. :)
The hint about docker in docker is useful (a couple of application suffer of this problem). 👍
ppamorim commentedon Aug 4, 2021
I don't understand this limitation, what's the difference between this and a VM running in the machine? We are using M1 machines as our hosts and since the native runner on macOS does not support containers, we decided to use Docker, but when executing it, we get this error.
scolastico commentedon Oct 10, 2021
Also its possible with docker to run a docker conatiner in a docker container.
You only need to mount the docker directory
/var/lib/dockerin the normal file system so it doesnt gets mounted as an AUFS mountpoint.This page i found describes a bit better than me: https://www.docker.com/blog/docker-can-now-run-within-docker/
pdomagala-tl commentedon Feb 22, 2022
@scolastico did you manage to do this?
scolastico commentedon Feb 22, 2022
not in this way but in another: https://github.com/scolastico-dev/s.RunnerManager
pdomagala-tl commentedon Feb 22, 2022
are you able to run docker inside the docker container?
scolastico commentedon Feb 23, 2022
Run docker inside docker: Yes with the link from above (https://www.docker.com/blog/docker-can-now-run-within-docker/).
But my solution from my last comment was not from that. My main problem why i saw that issue was that i wanted clean runner instances for selfhosting and so i developed a small programm which exactly does this. Its starting automatically runners as they are needed and deletes used ones.
nikola-jokic commentedon Dec 22, 2022
Hey everyone,
There is a bare-minimum runner image available now: ghcr.io/actions/actions-runner:latest
The Dockerfile is available here.
It is now part of the release process (#2250). The idea is to provide an image that can be used by
actions-runner-controller, but also as a stand-alone image.danm commentedon Jan 6, 2023
hi @nikola-jokic how do you use this image?
docker run ghcr.io/actions/actions-runner:2.300.2?nikola-jokic commentedon Jan 9, 2023
Hey @danm,
You would need to provide an entrypoint. Keep in mind, the entrypoint should know how to configure and run the runner. The entrypoint by default does not exist. So imperatively, you can provide an
--entrypointwithdocker run, or you can use thisDockerfileas a base for building your own minimal runner image.Spriz commentedon Jan 17, 2023
Hi @nikola-jokic - thanks for providing those Dockerfiles - is there any plans to support docker in docker? We're in the process of migrating from Gitlab CI/CD to Github Actions and it seems quite agressive to run autoscaling VMs compared to running 1-2 dedicated machines that runs 5-10 instances (that are ephemeral) of that container.
Either being able to use docker-in-docker, or having the agent support multiple workspaces on the same VM would both solve this.
CarlSargunar commentedon Apr 13, 2023
@danm did you get this runner working?
@nikola-jokic - I'm afraid I am not entirely following - could you elaborate on what needs to be done for the entry point? If I understand this right, by using the dockerfile you link to we can create our own images to set up runners and manage these?
Thanks in advance
danm commentedon Apr 13, 2023
Hi @CarlSargunar
This is the way we are creating the runner using Docker.
Create a directory with 2 files,
Dockerfileandrunner.shThe Dockerfile could look like this...
Dockerfile
runner.sh
Run
docker build --no-cache -t docker/github-runner .to build your image.Run
docker run docker/github-runnerThough I don't think you are supposed to use
runsvc.shanymore. Check the docs for the recommended. But it works great!uhthomas commentedon Mar 19, 2024
For anyone stumbling upon this in future, this one command should be enough. Just replace the URL and token.
❯ docker run -it ghcr.io/actions/actions-runner:2.314.1 sh -c './config.sh --url https://github.com/<user or org>/<repo> --token <token> --unattended && ./run.sh'(use
docker run -dinstead ofdocker run -itto run in the background)dorinclisu commentedon Mar 12, 2025
Here's my docker compose solution that survives host reboot, it works around the limitation that runner registration config paths are hardcoded. https://github.com/dorinclisu/devops-setup/tree/main/github_runner