aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile11
1 files changed, 9 insertions, 2 deletions
diff --git a/Dockerfile b/Dockerfile
index 6b834ff..d97cf15 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,8 +1,15 @@
+FROM --platform=$BUILDPLATFORM tinygo/tinygo:0.33.0 AS build
+ARG TARGETOS
+ARG TARGETARCH
+WORKDIR /app
+COPY . .
+RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOFLAGS=-buildvcs=false tinygo build -o locusts ./include
+
FROM scratch
LABEL org.opencontainers.image.licenses=0BSD
LABEL org.opencontainers.image.source=https://github.com/locusts-r-us/locusts
LABEL org.opencontainers.image.title=Locusts
LABEL org.opencontainers.image.description="A container that contains locusts"
HEALTHCHECK NONE
-COPY locusts /
-ENTRYPOINT ["/locusts"] \ No newline at end of file
+COPY --from=build /app/locusts /
+ENTRYPOINT ["/locusts"]