Docker GitHub Actions Runner

Docker GitHub Actions Runner
Photo by Roman Synkevych

This is a Docker image for to easily self-host GitHub actions runners. Hourly builds are available on Docker Hub.

https://github.com/0xC9C3/Docker-Github-Actions-Runner

I wanted to self-host GitHub actions runners, but I didn't want to install all the dependencies on my machine. So I created this image. This way I can easily run multiple runner on my server and use it for all my projects and even customize it, by extending this image.

An example of customization is the builder.Dockerfile.

FROM docker: 23.0 - dind AS docker

RUN cp / usr / local / bin / docker / usr / bin / docker

FROM 0xc9c3 / github_actions_runner: latest

COPY--from = docker / usr / bin / docker / usr / bin / docker

ENV RUNNER_ALLOW_RUNASROOT = 1

USER root

RUN apt - get update && apt - get install--yes jq \
    && rm - rf /var/lib/apt / lists/*

It uses this image as a base image and installs the jq package to be able to parse the GitHub API response. Also, it copies the docker binary from the dind image to be able to build and push docker images. This is needed because the docker image does not have docker installed. We also use the root user here because we need to be able to communicate with the docker socket.