From 6e3589c0b6d4ec9465e3b9a47db9cccde8bf7d57 Mon Sep 17 00:00:00 2001 From: Florian Uhlig Date: Tue, 14 Oct 2025 11:09:08 +0200 Subject: [PATCH] Test --- Dockerfile | 24 ++++++++++++++++++++++++ docker-compose.yml | 16 ++++++++++++++++ entrypoint.sh | 13 +++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f586dd2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM ubuntu:22.04 + +RUN apt-get update && apt-get install -y curl jq git sudo + +# Create a non-root user runneruser +RUN useradd -m runneruser && echo "runneruser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers + +RUN mkdir -p /actions-runner +WORKDIR /actions-runner + +COPY actions-runner.tar.gz actions-runner.tar.gz +RUN tar xzf ./actions-runner.tar.gz +RUN ./bin/installdependencies.sh + +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +# Change ownership of the runner directory to the non-root user +RUN chown -R runneruser:runneruser /actions-runner + +# Switch to non-root user +USER runneruser + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9e9b8e7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +services: + github-runner: + build: . + container_name: github-runner + environment: + RUNNER_TOKEN: "YourToken" + OWNER: "Your GitHub name" + REPO: "Your Repository name" + restart: unless-stopped + networks: + - net + +networks: + net: + name: docker_public + external: true diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..b4ff42a --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Check required env variables +if [ -z "$OWNER" ] || [ -z "$REPO" ] || [ -z "$RUNNER_TOKEN" ]; then + echo "Missing OWNER, REPO, or RUNNER_TOKEN environment variables." + exit 1 +fi + +# Configure the runner +./config.sh --url https://github.com/${OWNER}/${REPO} --token $RUNNER_TOKEN + +# Run the runner +./run.sh