gitea-act-runner/Dockerfile
Renovate Bot 475d052b31
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
Test Pull Requests / Build Image (pull_request) Successful in 6m11s
Test Pull Requests / Notify (pull_request) Successful in 3s
Build Develop Image / Build Image (push) Successful in 6m48s
Build Develop Image / Notify (push) Successful in 3s
Update golang Docker tag to v1.24
2025-02-23 10:00:28 +00:00

42 lines
1.4 KiB
Docker

FROM golang:1.24-alpine3.21 as builder
# Do not remove `git` here, it is required for getting runner version when executing `make build`
RUN apk add --no-cache make git
ARG ACT_VERSION=0.2.11
RUN git clone --depth 1 --branch v${ACT_VERSION} https://gitea.com/gitea/act_runner /opt/src/act_runner
WORKDIR /opt/src/act_runner
RUN make clean && make build
FROM docker:27.5.1-dind
USER root
RUN apk add --no-cache \
git bash supervisor python3 py3-pip
RUN pip3 install --break-system-packages supervisord-dependent-startup
COPY --from=builder /opt/src/act_runner/act_runner /usr/local/bin/act_runner
COPY --from=builder /opt/src/act_runner/scripts/supervisord.conf /etc/supervisord.conf
COPY --from=builder /opt/src/act_runner/scripts/run.sh /opt/act/run.sh
COPY --from=builder /opt/src/act_runner/scripts/rootless.sh /opt/act/rootless.sh
COPY /root /
RUN chmod +x /healthcheck.sh
ENV DOCKER_PRUNE_INTERVAL="0 0 * * *"
# Supress tini warning
ENV TINI_SUBREAPER=true
# Add Crontab for root user
RUN echo "${DOCKER_PRUNE_INTERVAL} echo Pruning docker volumes && docker volume prune -af" > .crontab.txt && crontab .crontab.txt
# Remove warning from supervisord about running as root
RUN sed -i '/\[supervisord\]/a user=root' /etc/supervisord.conf
HEALTHCHECK --interval=30s --timeout=15s --start-period=30s --retries=3 CMD "/healthcheck.sh"
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]