Skip to content

osl-incubator/github-actions-self-hosted-runner

Repository files navigation

Containerize a GitHub Actions self-hosted runner

This is a project heavily based on https://github.com/beikeni/github-runner-dockerfile The main difference is that it allows a more flexible approach to define the docker-compose.yaml file.

It is necessary to create a .env file with the desired environment variables:

$ envsubst < .env.tpl > .env

Change the values in .env to the values you need for your docker-compose file.

$ ./create-compose-file.sh

Run docker compose with the .env you just created:

$ docker compose --env-file .env build

You can also use make to call the following targets: build, start, and stop. It will automatically run docker compose with the dotenv file and call its subcommand properly.

In order to allow the Docker stack inside the GitHub Runner (that will be running as a Docker Contaienr), we need to use it with sysbox.

If you need to run it in a brand-new server, maybe you will need to follow the steps below:

References