Skip to content

arm: use official Ubuntu images instead of osrf custom ones - #1521

Merged
j-rivero merged 1 commit into
masterfrom
jrivero/arm64-official-ubuntu-images
Jul 27, 2026
Merged

arm: use official Ubuntu images instead of osrf custom ones#1521
j-rivero merged 1 commit into
masterfrom
jrivero/arm64-official-ubuntu-images

Conversation

@j-rivero

@j-rivero j-rivero commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The arm64 debbuilder was pinned to the manually-maintained osrf/ubuntu_arm64:${DISTRO} base images, built and pushed to Docker Hub by hand. The custom images were a 2016 workaround from before Docker offered native multi-arch base images and cross-arch emulation. armhf was already migrated off them (#647, #1135) using the official ubuntu:${DISTRO} image plus --platform.

Since Focal is EOL and no longer built, so its remaining osrf/ special case for armhf is dead code. Drop it and handle both arm arches with a single check.

Nowadays we are building images on native platforms so we can probably drop the platform argument for arm but I think that it does no hurt and it is robust if we decide to change to emulation at some point.

Assisted-By: Opus 4.8

The arm64 debbuilder was pinned to the manually-maintained
osrf/ubuntu_arm64:${DISTRO} base images, built and pushed to Docker
Hub by hand.

The custom images were a 2016 workaround from before Docker offered
native multi-arch base images and cross-arch emulation. armhf was
already migrated off them (#647, #1135) using the official
ubuntu:${DISTRO} image plus --platform.

focal is EOL and no longer built, so its remaining osrf/ special
case for armhf is dead code. Drop it and handle both arm arches with
a single check:

- docker_generate_dockerfile.bash: armhf and arm64 share one case
  using the official ubuntu:${DISTRO} base.
- docker_run.bash: pass --platform=linux/${ARCH} for both armhf and
  arm64.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Jose Luis Rivero <jrivero@honurobotics.com>

@azeey azeey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@scpeters

Copy link
Copy Markdown
Contributor

I've queued a build of gz-cmake5 arm64 on resolute

Build Status https://build.osrfoundation.org/job/gz-cmake5-debbuilder/406/

Just need for weekend schedule to end and an arm build machine to be re-added

@j-rivero
j-rivero merged commit b80b3bb into master Jul 27, 2026
4 checks passed
@j-rivero
j-rivero deleted the jrivero/arm64-official-ubuntu-images branch July 27, 2026 10:05
j-rivero added a commit that referenced this pull request Aug 6, 2026
armhf and arm64 debbuilds are served by the same agents (one machine
advertises both linux-armhf and linux-arm64). Since #1521 both arches
also use the same base image, so their Dockerfiles became identical.

Under the containerd image store a multi-arch FROM resolves to the
manifest index digest, which is the same for every platform, and the
legacy builder does not include --platform in its cache key. The two
chains therefore collide: the second arch to build on a given agent
adopts the first one's layers and keeps going on foreign-arch content
until the first freshly executed COPY/ADD does a platform-checked
lookup and aborts with:

  failed to get destination image "sha256:...": image with reference
  sha256:... was found but does not provide the specified platform
  (linux/arm64)

Observed in gz-math9-debbuilder #386, an arm64 build that cache-hit
steps 2-20 with image IDs identical to the armhf build #385 that had
just run on the same agent, and went on to install 305 _armhf.deb
before failing. Symmetrically in gz-tools2-debbuilder #3640, an armhf
build that installed 59 _arm64.deb after arm64 build #3639; its retry
#3641 landed on a fresh agent and passed. That agent-affinity is what
makes the failure look flaky.

Emit an arch-specific LABEL as the first instruction after FROM so the
chains diverge immediately, restoring the pre-#1521 property that two
architectures never share cached layers. It has to be first: placed any
later, the earlier shared instruction would already have adopted a
foreign-arch layer for the rest of the build to sit on.

This works around the legacy builder only. Migrating the agents to
BuildKit, which keys its cache by platform, is the durable fix.

Fixes #1529

Assited-by: Opus 5
Signed-off-by: Jose Luis Rivero <jrivero@honurobotics.com>
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