summaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-10-20 22:50:50 +0200
committerDaniel Baumann <daniel@debian.org>2024-10-20 22:50:50 +0200
commit9fa26b7837ed8e6679b7e6115425cab6ecbc9a8a (patch)
treec5b6f218ae267153042529217fdabeac4849ca1e /Dockerfile
parentInitial commit. (diff)
downloadforgejo-runner-9fa26b7837ed8e6679b7e6115425cab6ecbc9a8a.tar.xz
forgejo-runner-9fa26b7837ed8e6679b7e6115425cab6ecbc9a8a.zip
Adding upstream version 3.5.1.HEADupstream/3.5.1upstreamdebian
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile47
1 files changed, 47 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..50f1965
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,47 @@
+FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/tonistiigi/xx AS xx
+
+FROM --platform=$BUILDPLATFORM code.forgejo.org/oci/golang:1.21-alpine3.19 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
+
+# Do not remove `git` here, it is required for getting runner version when executing `make build`
+RUN apk add --no-cache build-base git
+
+COPY . /srv
+WORKDIR /srv
+
+RUN make clean && make build
+
+FROM code.forgejo.org/oci/alpine:3.19
+ARG RELEASE_VERSION
+RUN apk add --no-cache git bash
+
+COPY --from=build-env /srv/forgejo-runner /bin/forgejo-runner
+
+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."
+
+ENV HOME=/data
+
+USER 1000:1000
+
+WORKDIR /data
+
+VOLUME ["/data"]
+
+CMD ["/bin/forgejo-runner"]