mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-05-26 01:12:51 +00:00
Adds `org.opencontainers.image.source` and `org.opencontainers.image.version` labels to all three image variants (`basic`, `dind`, `dind-rootless`). - `source` lets tools like renovate retrieve release notes from the source repo. - `version` exposes the build version on the image itself. Both `release-tag` and `release-nightly` workflows pass `VERSION` as a build arg so the label reflects the actual git tag (or `git describe` output for nightly). --- This PR was written with the help of Claude Opus 4.7 --------- Reviewed-on: https://gitea.com/gitea/runner/pulls/975 Reviewed-by: Nicolas <bircni@icloud.com> Co-authored-by: silverwind <me@silverwind.io> Co-committed-by: silverwind <me@silverwind.io>
81 lines
1.7 KiB
Docker
81 lines
1.7 KiB
Docker
### BUILDER STAGE
|
|
#
|
|
#
|
|
FROM golang:1.26-alpine 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 GOPROXY
|
|
ENV GOPROXY=${GOPROXY:-}
|
|
|
|
COPY . /opt/src/runner
|
|
WORKDIR /opt/src/runner
|
|
|
|
RUN make clean && make build
|
|
|
|
### DIND VARIANT
|
|
#
|
|
#
|
|
FROM docker:29-dind AS dind
|
|
|
|
ARG VERSION=dev
|
|
|
|
LABEL org.opencontainers.image.source="https://gitea.com/gitea/runner"
|
|
LABEL org.opencontainers.image.version="${VERSION}"
|
|
|
|
RUN apk add --no-cache s6 bash git tzdata
|
|
|
|
COPY --from=builder /opt/src/runner/gitea-runner /usr/local/bin/gitea-runner
|
|
COPY scripts/run.sh /usr/local/bin/run.sh
|
|
COPY scripts/s6 /etc/s6
|
|
|
|
VOLUME /data
|
|
|
|
ENTRYPOINT ["s6-svscan","/etc/s6"]
|
|
|
|
### DIND-ROOTLESS VARIANT
|
|
#
|
|
#
|
|
FROM docker:29-dind-rootless AS dind-rootless
|
|
|
|
ARG VERSION=dev
|
|
|
|
LABEL org.opencontainers.image.source="https://gitea.com/gitea/runner"
|
|
LABEL org.opencontainers.image.version="${VERSION}"
|
|
|
|
USER root
|
|
RUN apk add --no-cache s6 bash git tzdata
|
|
|
|
COPY --from=builder /opt/src/runner/gitea-runner /usr/local/bin/gitea-runner
|
|
COPY scripts/run.sh /usr/local/bin/run.sh
|
|
COPY scripts/s6 /etc/s6
|
|
|
|
VOLUME /data
|
|
|
|
RUN mkdir -p /data && chown -R rootless:rootless /etc/s6 /data
|
|
|
|
ENV DOCKER_HOST=unix:///run/user/1000/docker.sock
|
|
|
|
USER rootless
|
|
ENTRYPOINT ["s6-svscan","/etc/s6"]
|
|
|
|
### BASIC VARIANT
|
|
#
|
|
#
|
|
FROM alpine AS basic
|
|
|
|
ARG VERSION=dev
|
|
|
|
LABEL org.opencontainers.image.source="https://gitea.com/gitea/runner"
|
|
LABEL org.opencontainers.image.version="${VERSION}"
|
|
|
|
RUN apk add --no-cache tini bash git tzdata
|
|
|
|
COPY --from=builder /opt/src/runner/gitea-runner /usr/local/bin/gitea-runner
|
|
COPY scripts/run.sh /usr/local/bin/run.sh
|
|
|
|
VOLUME /data
|
|
|
|
ENTRYPOINT ["/sbin/tini","--","run.sh"]
|