aspect-build / aspect-build/rules_buildx
[Bug]: No builder "rules_buildx_builder" found!
- Dominant language
- Starlark
- Stars
- 19
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
### What happened?
I would like to use rules_buildx to build my docker images with a dockerfile.
But if i build with bazel i get this error:
ERROR: /home/user/workspace/oci-images/platforms/base/BUILD:5:7: BuildX oci-images/platforms/base/base_image failed: (Exit 1): buildx failed: error executing BuildX command (from target //oci-images/platforms/base:base_image)
(cd /home/user/bazel_build_output/83b9925338edc0f1fe45523c687e506f/execroot/_main &&
exec env -
bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/aspect_rules_buildx+/buildx/resolved_toolchain/buildx build . --file bazel-out/k8-fastbuild/bin/oci-images/platforms/base/Dockerfile.base_image --builder rules_buildx_builder '--output=type=oci,tar=false,dest=bazel-out/k8-fastbuild/bin/oci-images/platforms/base/base_image' --build-arg 'SOURCE_DATE_EPOCH=0' '--build-context=XXX=oci-layout://bazel-out/k8-fastbuild/bin/oci-images/platforms/base/XXX')
Configuration: 37237223456aac1314230ca9a9fb2a278d80e4eb3b422da8939e984231a537159
Execution platform: @@platforms//host:host
ERROR: no builder "rules_buildx_builder" found
Target //oci-images/platforms/base:base_image failed to build
if i execute the command:
(cd /home/user/bazel_build_output/83b9925338edc0f1fe45523c687e506f/execroot/_main &&
exec env -
bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/aspect_rules_buildx+/buildx/resolved_toolchain/buildx build . --file bazel-out/k8-fastbuild/bin/oci-images/platforms/base/Dockerfile.base_image --builder rules_buildx_builder '--output=type=oci,tar=false,dest=bazel-out/k8-fastbuild/bin/oci-images/platforms/base/base_image' --build-arg 'SOURCE_DATE_EPOCH=0' '--build-context=XXX=oci-layout://bazel-out/k8-fastbuild/bin/oci-images/platforms/base/XXX')
it does not work but if i remove "exec env -" it works...
### Version
Development (host) and target OS/architectures: Ubuntu 22.04
Output of `bazel --version`: bazel 8.2.1
Version of the Aspect rules, or other relevant rules from your
`WORKSPACE` or `MODULE.bazel` file:
Contributor guide
Research direction
Start by reproducing the //oci-images/platforms/base:base_image target from the reported BUILD file and compare the generated BuildX command with and without `exec env -`. Trace how the `rules_buildx_builder` builder is selected in the rules_buildx integration; done means the Bazel target builds successfully while retaining the configured builder behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100