{"id":22741354,"url":"https://github.com/chaddyc/gha-runner","last_synced_at":"2025-12-30T23:17:52.291Z","repository":{"id":266140584,"uuid":"893013285","full_name":"chaddyc/gha-runner","owner":"chaddyc","description":"GitHub Actions Runner Docker Container","archived":false,"fork":false,"pushed_at":"2025-01-22T13:12:47.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T06:27:07.111Z","etag":null,"topics":["actions-runner","cicd","cicd-pipeline","docker","docker-compose","gha","gha-cicd","gha-runners","github","github-actions","github-runner","github-runners-management","kubernetes","kubernetes-runner"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/chaddyc/gha-runner","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaddyc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-23T09:56:39.000Z","updated_at":"2025-01-22T13:12:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"b8da3ff3-258c-4480-8b60-115b25d82ca0","html_url":"https://github.com/chaddyc/gha-runner","commit_stats":null,"previous_names":["chaddyc/gha-runner"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaddyc%2Fgha-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaddyc%2Fgha-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaddyc%2Fgha-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaddyc%2Fgha-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaddyc","download_url":"https://codeload.github.com/chaddyc/gha-runner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246273553,"owners_count":20750906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions-runner","cicd","cicd-pipeline","docker","docker-compose","gha","gha-cicd","gha-runners","github","github-actions","github-runner","github-runners-management","kubernetes","kubernetes-runner"],"created_at":"2024-12-11T00:09:57.225Z","updated_at":"2025-12-30T23:17:52.284Z","avatar_url":"https://github.com/chaddyc.png","language":"Dockerfile","readme":"# GitHub Actions Runner Docker\n\nThis guide provides detailed instructions for setting up a self-hosted GitHub Actions Runner using Docker. You can choose to run the container with `docker run` or `docker-compose`.\n\n## Prerequisites\n\nBefore starting, ensure you have the following:\n\n1. **Docker Installed**  \n   Ensure Docker is installed and running on your system. You can follow the [official installation guide](https://docs.docker.com/get-docker/) for help.\n\n2. **Docker Compose (Optional)**  \n   If using `docker-compose`, ensure it is installed. You can find installation instructions in the [official Docker Compose guide](https://docs.docker.com/compose/install/).\n\n3. **GitHub Runner Token**  \n   - Go to your GitHub repository or organization.  \n   - Navigate to **Settings \u003e Actions \u003e Runners**.\n   - Click **Add Runner** and copy the registration token provided.\n\n## Steps to Set Up the GitHub Actions Runner With Docker\n\nYou can set up the runner using either `docker run` or `docker-compose`. Choose the method that suits your setup.\n\n1. **Docker Run**\n   ```bash\n   docker run -d \\\n    -e GITHUB_URL=https://github.com/\u003cyour-org-or-repo\u003e \\\n    -e RUNNER_TOKEN=\u003cyour-runner-token\u003e \\\n    -e RUNNER_NAME=\u003cyour-runner-name\u003e \\\n    --name \u003ccontainer-name\u003e \\\n    chaddyc/gha-runner:latest\n   ```\n\n2. **Docker Compose**\n   ```yaml\n   services:\n    github-runner:\n        image: chaddyc/gha-runner:latest\n        container_name: \u003ccontainer-name\u003e\n        environment:\n        - GITHUB_URL=https://github.com/\u003cyour-org-or-repo\u003e\n        - RUNNER_TOKEN=\u003cyour-runner-token\u003e\n        - RUNNER_NAME=\u003cyour-runner-name\u003e\n        - RUNNER_LABELS=\u003clabel1,label2\u003e\n        volumes:\n         - /var/run/docker.sock:/var/run/docker.sock\n        restart: unless-stopped\n        # set runner resource limits [optional]\n        deploy:\n         resources:\n            limits:\n               cpus: \"2.0\"\n               memory: \"4G\"\n            reservations:\n               cpus: \"0.5\"\n               memory: \"1024\"\n      \n        \n   ```\n\n3. **Docker Compose - Multi Containers**\n   ```yaml\n   services:\n    github-runner:\n        image: chaddyc/gha-runner:latest\n        #container_name: \u003ccontainer-name\u003e\n        #don't use container name when deploying multi replica containers of your gha-runner\n        deploy:\n          mode: replicated\n          replicas: 2\n        environment:\n          - GITHUB_URL=https://github.com/\u003cyour-org-or-repo\u003e\n          - RUNNER_TOKEN=\u003cyour-runner-token\u003e\n          - RUNNER_NAME=\u003cyour-runner-name\u003e\n          - RUNNER_LABELS=\u003clabel1,label2\u003e\n        volumes:\n         - /var/run/docker.sock:/var/run/docker.sock\n        restart: unless-stopped\n        # set runner resource limits [optional]\n        deploy:\n         resources:\n            limits:\n               cpus: \"2.0\"\n               memory: \"4G\"\n            reservations:\n               cpus: \"0.5\"\n               memory: \"1024\"\n   ```\n\n4. **Kubernetes Deployment**\n\n   Create a new kubernetes secret for your Github Actions Runner Token like in the example below:\n\n   ```bash\n   kubectl create secret generic gha-runner-secret \\\n     --from-literal=RUNNER_TOKEN=\u003cyour-runner-token\u003e\n   ```\n\n   Create a kubernetes deployment `yaml` and call it `gha-runner-deployment.yml` and copy the below yaml file and update where needed such as the `image tag` if using a `specific version` other than `latest`:\n\n   ```yaml\n   apiVersion: apps/v1\n   kind: Deployment\n   metadata:\n   name: gha-runner-deployment\n   labels:\n      app: gha-runner\n   spec:\n   replicas: 1  # Number of runner instances\n   selector:\n      matchLabels:\n         app: gha-runner\n   template:\n      metadata:\n         labels:\n         app: gha-runner\n      spec:\n         containers:\n         - name: gha-runner\n            image: chaddyc/gha-runner:latest  # Replace Docker image tag if not going to use latest\n            imagePullPolicy: IfNotPresent\n            env:\n               - name: GITHUB_URL\n               value:  \"https://github.com/\u003cyour-org-or-repo\u003e\" # Replace with your GitHub URL org or repo\n               - name: RUNNER_NAME\n               value:  \"\u003cyour-runner-name\u003e\" # Name you want to give your runner\n               - name: RUNNER_TOKEN # pull runner token from secret value created\n               valueFrom:\n                  secretKeyRef:\n                     name: gha-runner-secret  # Kubernetes Secret name\n                     key: RUNNER_TOKEN      # Key in the secret holding the token\n            resources:\n               limits:\n               cpu: \"4\"\n               memory: \"8Gi\"\n               requests:\n               cpu: \"2\"\n               memory: \"4Gi\"\n   ```\n\n   Run the below command to create your deployment - ensure that you are in the correct `namespace` where you want to deploy your runner:\n   \n   ```bash\n   kubectl apply -f gha-runner-deployment.yml\n   ```\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaddyc%2Fgha-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaddyc%2Fgha-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaddyc%2Fgha-runner/lists"}