RISC-V Docker image - unofficial build that works around riscv64 blockers #9118
12345qwert123456
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone,
I've been running TriliumNext on an OrangePi RV2 and wanted to share a working Dockerfile for linux/riscv64, since the official image doesn't publish a riscv64 manifest.
Built and tested against TriliumNext v0.102.1, also runs fine under QEMU riscv64 on a regular x86-64 machine - so anyone can try it without physical hardware.
Why a straight cross-build fails on riscv64
There are three blockers I ran into:
node:*-alpineimage for riscv64 - Alpine's ownnodejspackage is used insteadkMaxBranchOffsetout-of-range error on riscv64;lightningcssalso has no prebuilt binary for this archbetter-sqlite3has no prebuilt binary fornode-v127-linux-riscv64and must be compiled from source via node-gypHow the Dockerfile solves this
The build is split into stages:
main.cjsvia esbuild, which ships a prebuilt riscv64 binary) andbetter-sqlite3are compiled natively on riscv64public/,pdfjs-viewer/,share-theme/) is copied from the official AMD64 image usingCOPY --fromnoRUNcommands, so Docker never executes AMD64 code and QEMU is not required at build time for this stageThe result is a minimal Alpine image that runs the server natively on riscv64.
Proof of works
Repo & Docker Hub
GitHub: https://github.com/12345qwert123456/Trilium.RISC-V
Docker Hub: https://hub.docker.com/r/12345qwert123456/trilium-riscv64
The repo includes a GitHub Actions workflow that automatically tracks new stable TriliumNext releases and rebuilds the image.
Happy to turn this into a PR if there's interest in adding riscv64 to the official image build matrix. The main question would be where the frontend layers should come from in a fully integrated CI pipeline - open to suggestions.
Beta Was this translation helpful? Give feedback.
All reactions