Refactor Dockerfiles for Gitea runners: streamline package installations, remove unnecessary dependencies, and ensure non-root execution
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user