Skip to content

fix: ubuntu:24.04 base image + remove platforms: flag to fix ARM64 on RK3588#149

Merged
NotPunchnox merged 4 commits into
NotPunchnox:mainfrom
schwankner:fix/arm64-ubuntu-base
May 3, 2026
Merged

fix: ubuntu:24.04 base image + remove platforms: flag to fix ARM64 on RK3588#149
NotPunchnox merged 4 commits into
NotPunchnox:mainfrom
schwankner:fix/arm64-ubuntu-base

Conversation

@schwankner

Copy link
Copy Markdown
Contributor

Problems fixed

Two separate issues combined to make the published image unusable on RK3588 hardware since PR #141.

1. BuildKit cache contamination (CI workflow)

setup-buildx-action with platforms: linux/arm64 on a native ubuntu-24.04-arm runner forces a QEMU-backed docker-container builder instead of using the host builder. This builder shares a layer cache namespace with amd64 builds. The old :buildcache registry tag still contained amd64 base OS layers, so subsequent arm64 builds pulled those stale layers — producing an image where /bin/sh and the entire base OS are amd64 ELF, causing exec format error at container startup.

Fix: Remove platforms: linux/arm64 from both setup-buildx-action and build-push-action. On a native arm64 runner, omitting the flag builds for the host architecture without QEMU. Rename the cache key to :buildcache-arm64 to avoid reusing the poisoned cache.

2. Pointer Authentication (PAC) incompatibility with Debian base (Dockerfile)

Even with a correctly built arm64 image, python:3.12-slim (Debian Trixie) cannot run on RK3588. Debian Trixie ARM64 packages are compiled with Pointer Authentication (PAC), an ARMv8.3-A feature. The RK3588 SoC (Cortex-A76 + Cortex-A55) implements ARMv8.2-A only — it has no PAC hardware. The Linux kernel returns ENOEXEC when attempting to execute a PAC-guarded ELF binary on hardware without PAC support, which is why /usr/bin/python3.12 and even /bin/sh immediately crash.

Ubuntu 24.04 ARM64 packages are not compiled with PAC and run correctly on ARMv8.2-A hardware including RK3588, RK3568, and other Rockchip SoCs.

Fix: Change FROM python:3.12-slimFROM ubuntu:24.04. Install Python 3.12 from Ubuntu apt packages. Use a venv to work around Ubuntu 24.04's PEP 668 pip restriction.

Verification

After this fix the image must:

  • Have ELF machine byte 0xb7 (EM_AARCH64) for all binaries: od -An -j18 -N1 -tx1 /usr/bin/python3.12
  • Start rkllama_server without exec format error on RK3588 hardware
  • Load and serve RKLLM models

Changes

File Change
Dockerfile FROM ubuntu:24.04 instead of python:3.12-slim; add venv; install Python from apt
.github/workflows/docker-publish.yml Remove platforms: linux/arm64 from both Buildx steps; rename cache key to :buildcache-arm64

python:3.12-slim (Debian Trixie) ARM64 packages are compiled with Pointer
Authentication (PAC, ARMv8.3-A).  RK3588 (Cortex-A76/A55) is ARMv8.2-A
and does not implement PAC.  The Linux kernel returns ENOEXEC for
PAC-guarded ELF binaries on hardware without PAC support, causing an
'exec format error' even though the image is correctly built for arm64.

Ubuntu 24.04 ARM64 packages do not use PAC and run correctly on RK3588.

Use a venv to work around Ubuntu 24.04 PEP 668 pip restrictions.
…che contamination

On an ubuntu-24.04-arm native runner, setting platforms: linux/arm64 in
setup-buildx-action forces a docker-container driver (QEMU-backed) instead
of using the host builder.  This causes the layer cache to be shared with
amd64 builds, pulling stale amd64 base OS layers into an arm64 image.

Rename the registry cache key from :buildcache to :buildcache-arm64 to
avoid reusing the stale amd64 cache that accumulated before this fix.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the container build and publish pipeline to restore usability on RK3588 (ARMv8.2-A) by avoiding Debian/PAC-incompatible base layers and preventing ARM64 builds from reusing a contaminated cache.

Changes:

  • Switch Docker base image to ubuntu:24.04, install Python 3.12 via apt, and use a venv to work around PEP 668 restrictions.
  • Adjust GitHub Actions docker publish workflow to omit explicit platforms: linux/arm64 on a native ARM64 runner and use a new :buildcache-arm64 registry cache tag.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
Dockerfile Changes base image to Ubuntu 24.04, installs Python from apt, and uses a venv before installing the project.
.github/workflows/docker-publish.yml Removes explicit platforms: and renames the registry cache tag for ARM64 builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/docker-publish.yml
Comment thread .github/workflows/docker-publish.yml Outdated
Comment thread .github/workflows/docker-publish.yml Outdated
schwankner added 2 commits May 1, 2026 13:58
…ldx comment

Revert action major versions to what was present before this PR:
- actions/checkout@v6
- sigstore/cosign-installer@v4.1.1
- docker/setup-buildx-action@v4
- docker/login-action@v4
- docker/metadata-action@v6

These downgrades were not required for the ARM64/PAC fix and could
introduce unintended behaviour differences (Copilot review feedback).

Also fix the misleading comment on setup-buildx-action: the action uses
a docker-container builder by default, not a "host builder".  The
comment now correctly describes why omitting `platforms:` avoids
QEMU-backed cross-compilation and cache contamination.
The previous commit accidentally dropped the original workflow comments
(copyright header, step descriptions, URLs, sigstore notes) and
downgraded build-push-action from v7 to v6.

This commit restores all original comments verbatim and integrates the
ARM64 explanation as NOTE blocks within the existing comment sections,
keeping the diff minimal and reviewable.
@NotPunchnox NotPunchnox merged commit f00bd9c into NotPunchnox:main May 3, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants