summaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2025-01-24 08:57:48 +0100
committerDaniel Baumann <daniel@debian.org>2025-01-24 08:57:48 +0100
commitc70c95ecbea0487586212a9437d120989a6c6e31 (patch)
tree140d166690b4cf72737075f15001eee07bfb4d6c /Dockerfile
parentInitial commit. (diff)
downloadforgejo-runner-debian.tar.xz
forgejo-runner-debian.zip
Adding upstream version 6.2.0.HEADupstream/6.2.0upstreamdebian
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..6acc805
--- /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.23-alpine3.20 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.20
+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"]