Skip to content

MatthewGlenn/github-runner

 
 

Repository files navigation

Github self-hosted runner Dockerfile and Kubernetes configuration

This is a fork of @SanderKnape's repo that builds the github-runner automatically

Actions Status

Image Version

This repository contains a Dockerfile that builds a Docker image suitable for running a self-hosted GitHub runner. A Kubernetes Deployment file is also included that you can use as an example on how to deploy this container to a Kubernetes cluster.

Building the container

docker build -t github-runner .

Features

  • Repository runners
  • Organizational runners
  • Labels
  • Graceful shutdown
  • Support for installing additional debian packages
  • Auto-update after the release of a new version

Examples

Register a runner to a repository.

docker run --name github-runner \
     -e GITHUB_OWNER=username-or-organization \
     -e GITHUB_REPOSITORY=my-repository \
     -e GITHUB_PAT=[PAT] \
     ghcr.io/matthewglenn/github-runner:latest

Register a runner with github token.

docker run --name github-runner \
     -e GITHUB_OWNER=username-or-organization \
     -e GITHUB_REPOSITORY=my-repository \
     -e GITHUB_TOKEN=[github.token] \
     ghcr.io/matthewglenn/github-runner:latest

Create an organization-wide runner.

docker run --name github-runner \
    -e GITHUB_OWNER=username-or-organization \
    -e GITHUB_PAT=[PAT] \
    ghcr.io/matthewglenn/github-runner:latest

Set labels on the runner.

docker run --name github-runner \
    -e GITHUB_OWNER=username-or-organization \
    -e GITHUB_REPOSITORY=my-repository \
    -e GITHUB_PAT=[PAT] \
    -e RUNNER_LABELS=comma,separated,labels \
    ghcr.io/matthewglenn/github-runner:latest

Install additional tools on the runner.

docker run --name github-runner \
    -e GITHUB_OWNER=username-or-organization \
    -e GITHUB_REPOSITORY=my-repository \
    -e GITHUB_PAT=[PAT] \
    -e ADDITIONAL_PACKAGES=firefox-esr,chromium \
    ghcr.io/matthewglenn/github-runner:latest

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Shell 68.7%
  • Dockerfile 31.3%