1 Commits

Author SHA1 Message Date
e17331f809 new file: .dockerignore
modified:   Dockerfile
2025-10-23 14:23:35 +02:00
2 changed files with 46 additions and 13 deletions

7
.dockerignore Normal file
View File

@@ -0,0 +1,7 @@
.git
.gitignore
README.md
Dockerfile
.dockerignore
compose.yml
docker-compose.yml

View File

@@ -1,24 +1,50 @@
FROM ubuntu:22.04
# Bessere Alternative: Direkter Download
FROM alpine:3.19 AS builder
RUN apt-get update && apt-get install -y curl jq git sudo
RUN apk update && apk add --no-cache \
curl \
tar \
gzip \
bash \
ca-certificates
# Create a non-root user runneruser
RUN useradd -m runneruser && echo "runneruser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
ARG RUNNER_VERSION=2.310.2
WORKDIR /tmp
# Lade GitHub Actions Runner direkt herunter
RUN curl -o actions-runner.tar.gz -L \
"https://github.com/actions/runner/releases/download/v2.329.0/actions-runner-linux-x64-2.329.0.tar.gz"
# Erstelle Zielverzeichnis
RUN mkdir -p /tmp/actions-runner
# Extrahiere direkt ohne --strip-components (oft problematisch)
RUN tar xzf actions-runner.tar.gz -C /tmp/actions-runner
# Runtime Stage
FROM alpine:3.19
RUN apk update && apk add --no-cache \
curl \
jq \
git \
bash \
sudo \
ca-certificates \
&& rm -rf /var/cache/apk/*
RUN adduser -D -s /bin/bash 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
# Kopiere extrahierte Dateien
COPY --from=builder /tmp/actions-runner ./
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN chmod +x /entrypoint.sh && \
chown -R runneruser:runneruser /actions-runner
# 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"]