mirror of
https://github.com/typst/typst
synced 2025-05-13 12:36:23 +08:00
Fix dockerfile not cross compiling correctly (#5294)
This commit is contained in:
parent
b88ec6016e
commit
36f8cdf91b
8
.github/workflows/docker-image.yml
vendored
8
.github/workflows/docker-image.yml
vendored
@ -36,18 +36,18 @@ jobs:
|
||||
run: echo "TYPST_BUILD_DATE=\"$(date -u +'%Y-%m-%dT%H:%M:%SZ')\" >> $GITHUB_ENV"
|
||||
|
||||
- name: Setup Docker buildx
|
||||
uses: docker/setup-buildx-action@v3.1.0
|
||||
uses: docker/setup-buildx-action@v3.7.1
|
||||
with:
|
||||
platforms: ${{ matrix.platform }}
|
||||
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5.0.0
|
||||
uses: docker/metadata-action@v5.5.1
|
||||
with:
|
||||
images: ${{ env.IMAGE_NAME }}
|
||||
|
||||
- name: Log into registry ${{ env.REGISTRY }}
|
||||
uses: docker/login-action@v3.0.0
|
||||
uses: docker/login-action@v3.3.0
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
@ -55,7 +55,7 @@ jobs:
|
||||
|
||||
- name: Build Docker image
|
||||
id: build
|
||||
uses: docker/build-push-action@v5.1.0
|
||||
uses: docker/build-push-action@v6.9.0
|
||||
with:
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
platforms: ${{ matrix.platform }}
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user