runner/Dockerfile

30 lines
774 B
Text
Raw Permalink Normal View History

2024-12-29 19:58:04 +00:00
FROM code.forgejo.org/forgejo/runner:5 AS runner
FROM debian:bullseye
COPY --from=runner /bin/forgejo-runner /bin/forgejo-runner
2024-11-03 22:16:04 +00:00
USER root
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
2024-12-29 19:58:04 +00:00
# Install required packages
RUN apt-get update && \
apt-get install -y sudo lxc lxc-templates uidmap && \
apt-get clean
# Configure user and permissions
RUN useradd -m runner && \
echo "runner ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/runner && \
chmod 0440 /etc/sudoers.d/runner && \
mkdir /data && chown runner:runner /data
# Enable subuid and subgid for unprivileged containers
RUN echo "runner:100000:65536" >> /etc/subuid && \
echo "runner:100000:65536" >> /etc/subgid
VOLUME [ "/data" ]
WORKDIR /data
ENTRYPOINT [ "/entrypoint.sh" ]