bazelbuild / rules_docker

Rules for building and handling Docker images with Bazel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Default to Bazel target architecture

pauldraper opened this issue Β· comments

πŸš€ 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.

commented

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,

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",