Skip to content

fix(docker): fall back to host arch for local builds#1420

Open
elezar wants to merge 1 commit into
mainfrom
fix-docker-host-arch-only
Open

fix(docker): fall back to host arch for local builds#1420
elezar wants to merge 1 commit into
mainfrom
fix-docker-host-arch-only

Conversation

@elezar
Copy link
Copy Markdown
Member

@elezar elezar commented May 18, 2026

Summary

Fall back to the host architecture for local container builds when no explicit platform is configured. This was detected on a clean DGX Spark with Podman installed and Docker not runnable by the current user.

Related Issue

None.

Changes

  • Added host architecture fallback in local container engine platform detection.
  • Updated build documentation for local platform behavior.

Testing

  • mise run pre-commit passes
  • Unit tests added/updated (not applicable)
  • E2E tests added/updated (not applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)

(cherry picked from commit 392ab51f58fc18e03e721cdfa21f666091c67b80)
Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar elezar requested review from a team, derekwaynecarr, maxamillion and mrunalp as code owners May 18, 2026 07:38
@ericcurtin
Copy link
Copy Markdown
Contributor

This looks fine, but I feel like we could check arch in less places:

  case "$(uname -m)" in
    x86_64|amd64) echo "amd64" ;;
    aarch64|arm64) echo "arm64" ;;
    *) echo "$1" ;;
  esac

would cover almost everything except for Windows native. (ignoring emulation)

@elezar
Copy link
Copy Markdown
Member Author

elezar commented May 18, 2026

@ericcurtin what do you mean by:

we could check arch in less places:

We attempt to determine the architecture (for building th econtainers) from the container engine being used and only use the host architecture if these fail.

Note that this fixes the overly broad fallback from https://github.com/NVIDIA/OpenShell/pull/904/changes#diff-c175bbdd5dfb89f433966a57cb620726a4cd40dc35c58bfd2dd0b1ab0cc597d6R176-R182 which is only relevent on systems where neither docker nor podman works as expected and causes the mise build task to fail.

@ericcurtin
Copy link
Copy Markdown
Contributor

ericcurtin commented May 18, 2026

Things like:

docker info --format '{{.Architecture}}'

and

uname -m

should always match (barring the aarch64/arm64 Linux/macOS thing). The only case where it doesn't is where the docker daemon is running in an environment that is of a different architecture (which may not be a corner case worth considering). Would be a mass simplification to just check "uname -m", but your choice

@elezar
Copy link
Copy Markdown
Member Author

elezar commented May 18, 2026

What about cases where the daemon is running remotely? The server architecture may be different from the client. With that said, we may want to check with @maxamillion on why the specific logic was chosen.

@maxamillion
Copy link
Copy Markdown
Collaborator

@elezar I honestly didn't go that far down the rabbit hole, I had not considered an use case where the container host could be remote

Copy link
Copy Markdown
Collaborator

@maxamillion maxamillion left a comment

Choose a reason for hiding this comment

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

LGTM

@maxamillion
Copy link
Copy Markdown
Collaborator

@ericcurtin were there changes you wanted to see here or are we good to merge?

@ericcurtin
Copy link
Copy Markdown
Contributor

ericcurtin commented May 18, 2026

@ericcurtin were there changes you wanted to see here or are we good to merge?

Oh sorry, this was always good :) I was just suggesting a simplification, not attempting to block

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