Refactor Dockerfiles for Gitea runners: streamline package installations, remove unnecessary dependencies, and ensure non-root execution
This commit is contained in:
@@ -1,31 +1,21 @@
|
||||
FROM local/gitea-runner-base:latest
|
||||
|
||||
# cicd-base runner profile: common CI build and release tooling.
|
||||
# Base image sets USER runner; switch back to root for package installs
|
||||
USER root
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
buildah \
|
||||
ca-certificates \
|
||||
curl \
|
||||
fuse-overlayfs \
|
||||
git \
|
||||
iptables \
|
||||
jq \
|
||||
make \
|
||||
openssh-client \
|
||||
podman \
|
||||
python3 \
|
||||
python3-pip \
|
||||
rsync \
|
||||
skopeo \
|
||||
slirp4netns \
|
||||
uidmap \
|
||||
unzip \
|
||||
zip \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN mkdir -p /etc/containers /var/lib/containers /run/containers && \
|
||||
printf '%s\n' '[storage]' 'driver = "vfs"' > /etc/containers/storage.conf && \
|
||||
printf '%s\n' '[engine]' > /etc/containers/containers.conf
|
||||
printf '%s\n' '[engine]' > /etc/containers/containers.conf && \
|
||||
chown -R 1000:1000 /var/lib/containers
|
||||
|
||||
ENV BUILDAH_ISOLATION=chroot
|
||||
ENV STORAGE_DRIVER=vfs
|
||||
@@ -36,3 +26,6 @@ RUN curl -fsSL -o /tmp/trivy.tar.gz \
|
||||
tar -xzf /tmp/trivy.tar.gz -C /tmp && \
|
||||
install -m 0755 /tmp/trivy /usr/local/bin/trivy && \
|
||||
rm -f /tmp/trivy.tar.gz /tmp/trivy
|
||||
|
||||
# Default to non-root execution
|
||||
USER runner
|
||||
|
||||
Reference in New Issue
Block a user