summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2024-04-16 11:40:08 +0200
committerGitHub <noreply@github.com>2024-04-16 09:40:08 +0000
commit1f8454fa545a045478a5689f335b6b143c2ac00e (patch)
tree140619cf5bac070cfd78786292b80cc320c8be33 /Dockerfile
parent401ba82927e2087afc1711e5d62583928f3b378c (diff)
Dockerfile: add `ENTRYPOINT` directive (#3798)
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile18
1 files changed, 16 insertions, 2 deletions
diff --git a/Dockerfile b/Dockerfile
index 78985d4d..b6723a01 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,3 +1,7 @@
+ARG CREATED
+ARG REVISION
+ARG TARGETPLATFORM
+
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
FROM --platform=$BUILDPLATFORM rust:alpine AS build
COPY --from=xx / /
@@ -11,7 +15,6 @@ 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 \
@@ -23,5 +26,16 @@ RUN --mount=type=cache,target=/root/.cargo/git/db \
xx-verify target/release/typst
FROM alpine:latest
-WORKDIR /root/
+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"
+LABEL org.opencontainers.image.documentation="https://typst.app/docs"
+LABEL org.opencontainers.image.licenses="Apache-2.0"
+LABEL org.opencontainers.image.revision=${REVISION}
+LABEL org.opencontainers.image.source="https://github.com/typst/typst"
+LABEL org.opencontainers.image.title="Typst Docker image"
+LABEL org.opencontainers.image.url="https://typst.app"
+LABEL org.opencontainers.image.vendor="Typst"
+
COPY --from=build /app/target/release/typst /bin
+ENTRYPOINT [ "/bin/typst" ]