Sign inSign up

michaelcoll/github-runner

By michaelcoll

•Updated about 4 years ago

Image
0

10K+

michaelcoll/github-runner repository overview

⁠Github self-hosted runner Dockerfile and Kubernetes configuration

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.

You can build this image yourself, or use the Docker image from the Docker Hub⁠.

⁠Building the container

docker build -t github-runner .

⁠Features

  • Organizational runners
  • Labels
  • Graceful shutdown

⁠Deploying to Kubernetes

  1. Get a token in your organisation settings -> Actions -> Add runner

  2. Modify deployment.yml fields to target your repository and org token:

data:
    # Base64 encoded of the token
    TOKEN: <a base64 encoded token>
[...]
env:
    - name: ORG_NAME
      value: <YOUR ORG>
  1. Create the deployment:
$ kubectl apply -f deployment.yml

⁠Examples

Create an organization-wide runner.

docker run --name github-runner \
    -e ORG_NAME=organization \
    -e TOKEN=[token] \
    michaelcoll/github-runner:latest

Set labels on the runner.

docker run --name github-runner \
    -e ORG_NAME=organization \
    -e TOKEN=[token] \
    -e RUNNER_LABELS=comma,separated,labels \
    michaelcoll/github-runner:latest

Tag summary

Content type

Image

Digest

sha256:5e00b15c9…

Size

336.7 MB

Last updated

about 4 years ago

docker pull michaelcoll/github-runner