mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 22:30:54 +01:00
statically compiled arm64 pkl binary for usage in distroless containers #320
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @wfairclough on GitHub (Jul 20, 2025).
Hey team, we’re running PKL in arm64 distroless containers and hit a snag: the current PKL release isn’t statically compiled for arm64, so we’re running into dependency issues at runtime. Would it be possible to provide a statically compiled arm64 version of PKL as part of the release artifacts? This would make it much easier to use PKL in minimal container environments.
We really want to use pkl as our go to config language for our services, we love the protection we would get with runtime config validation.
I tried making the changes myself and successfully compiled an arm64 statically compiled binary on an arm64 Ubuntu VM. However, it still did not work in the distroless container. I assumed I must have done something wrong and that I did not actually achieve a static compilation.
The changes I made to the build scripts are here: pkl-cli/pkl-cli.gradle.kts
Thanks!
@bioball commented on GitHub (Jul 22, 2025):
The existing linux/arm64 executable is a "mostly static", where it dynamically links to glibc and libstd++. Can you try using
distroless/ccas your base image? That should have all the dependencies that Pkl needs.@wfairclough commented on GitHub (Jul 22, 2025):
@bioball, thank you for your suggestion. I tried that as well, but it seems there are more missing dependencies.