Refactor Dockerfiles for Gitea runners: streamline package installations, remove unnecessary dependencies, and ensure non-root execution

This commit is contained in:
2026-07-07 20:50:04 +02:00
parent 58ca1561ec
commit c1c2d1c83b
4 changed files with 30 additions and 38 deletions
@@ -10,14 +10,29 @@ RUN chmod +x /usr/local/bin/run.sh
ENTRYPOINT ["/usr/local/bin/run.sh"]
# Create dedicated runner user (UID 1000) for non-root container execution
RUN groupadd -g 1000 runner && \
useradd -u 1000 -g 1000 -m -d /home/runner -s /bin/bash runner
# Install runner tooling
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
ca-certificates \
curl \
git \
jq \
make \
nodejs \
openssh-client \
python3 \
python3-pip \
rsync \
unzip \
zip \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/*
# Set work directory
ENV RUNNER_WORKDIR=/home/runner
# Ensure container runs as non-root by default
USER runner