summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorAdrian Freund <adrian@freund.io>2024-10-31 16:54:35 +0100
committerGitHub <noreply@github.com>2024-10-31 15:54:35 +0000
commit36f8cdf91b909bc9334a7afa63a969d6a8b9ce68 (patch)
tree1520077f1f6a8b79daff31fd6931b8fa5d48c470 /Dockerfile
parentb88ec6016eacd390c7e68344c50049764515eba9 (diff)
Fix dockerfile not cross compiling correctly (#5294)
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile
index b6723a01..f118b61d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,9 +1,6 @@
-ARG CREATED
-ARG REVISION
-ARG TARGETPLATFORM
-
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM rust:alpine AS build
+
COPY --from=xx / /
RUN apk add --no-cache clang lld
@@ -15,6 +12,8 @@ RUN --mount=type=cache,target=/root/.cargo/git/db \
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse \
cargo fetch
+ARG TARGETPLATFORM
+
RUN xx-apk add --no-cache musl-dev openssl-dev openssl-libs-static
RUN --mount=type=cache,target=/root/.cargo/git/db \
--mount=type=cache,target=/root/.cargo/registry/cache \
@@ -26,6 +25,8 @@ RUN --mount=type=cache,target=/root/.cargo/git/db \
xx-verify target/release/typst
FROM alpine:latest
+ARG CREATED
+ARG REVISION
LABEL org.opencontainers.image.authors="The Typst Project Developers <hello@typst.app>"
LABEL org.opencontainers.image.created=${CREATED}
LABEL org.opencontainers.image.description="A markup-based typesetting system"