2024-08-13 13:00:37 +01:00
|
|
|
FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/tonistiigi/xx AS xx
|
2023-08-23 20:57:06 +01:00
|
|
|
|
2024-08-13 14:15:38 +01:00
|
|
|
FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/golang:1.21-alpine3.19 as build-env
|
2023-08-23 20:57:06 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Transparently cross compile for the target platform
|
|
|
|
#
|
|
|
|
COPY --from=xx / /
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
RUN apk --no-cache add clang lld
|
|
|
|
RUN xx-apk --no-cache add gcc musl-dev
|
|
|
|
RUN xx-go --wrap
|
|
|
|
|
2023-08-13 13:20:56 +01:00
|
|
|
# Do not remove `git` here, it is required for getting runner version when executing `make build`
|
2023-08-23 20:57:06 +01:00
|
|
|
RUN apk add --no-cache build-base git
|
2023-04-30 17:13:11 +01:00
|
|
|
|
|
|
|
COPY . /srv
|
|
|
|
WORKDIR /srv
|
2023-08-13 13:20:56 +01:00
|
|
|
|
|
|
|
RUN make clean && make build
|
2023-04-30 17:13:11 +01:00
|
|
|
|
2024-08-13 14:15:38 +01:00
|
|
|
FROM code.forgejo.org/oci/alpine:3.19
|
2024-05-19 15:20:33 +01:00
|
|
|
ARG RELEASE_VERSION
|
2023-08-23 20:57:06 +01:00
|
|
|
RUN apk add --no-cache git bash
|
|
|
|
|
|
|
|
COPY --from=build-env /srv/forgejo-runner /bin/forgejo-runner
|
|
|
|
|
2024-05-19 15:20:33 +01:00
|
|
|
LABEL maintainer="contact@forgejo.org" \
|
|
|
|
org.opencontainers.image.authors="Forgejo" \
|
|
|
|
org.opencontainers.image.url="https://forgejo.org" \
|
|
|
|
org.opencontainers.image.documentation="https://forgejo.org/docs/latest/admin/actions/#forgejo-runner" \
|
|
|
|
org.opencontainers.image.source="https://code.forgejo.org/forgejo/runner" \
|
|
|
|
org.opencontainers.image.version="${RELEASE_VERSION}" \
|
|
|
|
org.opencontainers.image.vendor="Forgejo" \
|
|
|
|
org.opencontainers.image.licenses="MIT" \
|
|
|
|
org.opencontainers.image.title="Forgejo Runner" \
|
|
|
|
org.opencontainers.image.description="A runner for Forgejo Actions."
|
|
|
|
|
2023-08-23 20:57:06 +01:00
|
|
|
ENV HOME=/data
|
|
|
|
|
2024-09-25 21:00:54 +01:00
|
|
|
COPY --chmod=555 entrypoint.sh /entrypoint.sh
|
2023-08-23 20:57:06 +01:00
|
|
|
|
|
|
|
WORKDIR /data
|
2023-04-30 17:13:11 +01:00
|
|
|
|
2023-08-23 20:57:06 +01:00
|
|
|
VOLUME ["/data"]
|
2023-04-30 17:13:11 +01:00
|
|
|
|
2024-09-25 17:46:06 +01:00
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|