Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e17331f809 | |||
| 499c0270af |
7
.dockerignore
Normal file
7
.dockerignore
Normal file
@@ -0,0 +1,7 @@
|
||||
.git
|
||||
.gitignore
|
||||
README.md
|
||||
Dockerfile
|
||||
.dockerignore
|
||||
compose.yml
|
||||
docker-compose.yml
|
||||
52
Dockerfile
52
Dockerfile
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user