Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Default to Bazel target architecture #2245

Open
pauldraper opened this issue Apr 12, 2023 · 2 comments
Open

Default to Bazel target architecture #2245

pauldraper opened this issue Apr 12, 2023 · 2 comments

Comments

@pauldraper
Copy link

pauldraper commented Apr 12, 2023

🚀 feature request

Relevant Rules

container_image

Description

The target architecture is always transitioned. By default it transitions to amd64.

The sensible behavior is to use the current target architecture. It's weird that it doesn't, and rules_docker seems to have gone out of its way(?) to make it like that.

Describe the solution you'd like

--

Describe alternatives you've considered

Disable rules_docker transitions and do it myself.

@uhthomas
Copy link
Collaborator

uhthomas commented May 5, 2023

It should transition to the target architecture of the image, given:

"@io_bazel_rules_docker//platforms:image_transition_cpu": "@platforms//cpu:" + {
# Architecture aliases.
"386": "x86_32",
"amd64": "x86_64",
"ppc64le": "ppc",
}.get(attr.architecture, attr.architecture),
"@io_bazel_rules_docker//platforms:image_transition_os": "@platforms//os:" + attr.operating_system,

@pauldraper
Copy link
Author

pauldraper commented Jun 5, 2023

Right, and my point is that the architecture of the image should default to the Bazel target platform (--cpu).

Currently, it defaults to amd64

default = "amd64",

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants