2023-08-23 14:57:06 -05:00
|
|
|
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
|
|
|
|
|
|
|
|
FROM --platform=$BUILDPLATFORM docker.io/library/golang:1.21-alpine3.18 as build-env
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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 07:20:56 -05:00
|
|
|
# Do not remove `git` here, it is required for getting runner version when executing `make build`
|
2023-08-23 14:57:06 -05:00
|
|
|
RUN apk add --no-cache build-base git
|
2023-04-30 11:13:11 -05:00
|
|
|
|
|
|
|
COPY . /srv
|
|
|
|
WORKDIR /srv
|
2023-08-13 07:20:56 -05:00
|
|
|
|
|
|
|
RUN make clean && make build
|
2023-04-30 11:13:11 -05:00
|
|
|
|
2023-08-23 14:57:06 -05:00
|
|
|
FROM docker.io/library/alpine:3.18
|
|
|
|
LABEL maintainer="contact@forgejo.org"
|
|
|
|
|
|
|
|
RUN apk add --no-cache git bash
|
|
|
|
|
|
|
|
COPY --from=build-env /srv/forgejo-runner /bin/forgejo-runner
|
|
|
|
|
|
|
|
ENV HOME=/data
|
|
|
|
|
|
|
|
USER 1000:1000
|
|
|
|
|
|
|
|
WORKDIR /data
|
2023-04-30 11:13:11 -05:00
|
|
|
|
2023-08-23 14:57:06 -05:00
|
|
|
VOLUME ["/data"]
|
2023-04-30 11:13:11 -05:00
|
|
|
|
2023-08-23 14:57:06 -05:00
|
|
|
CMD ["/bin/forgejo-runner"]
|