bazelbuild / bazelbuild/rules_docker

Building and testing rules_docker on Apple Silicon

Open
#2,036 9 comments 23 reactions 0 assignees View on GitHub
Can Close?
Dominant language
Starlark
Stars
1.1k
Forks
689
PR merge metrics
No merged PRs in 30d

Description

# 🚀 feature request

### Relevant Rules

### Description

Currently, the Go targets in rules_docker cannot build on Apple Silicon machines:

```
bazel build @io_bazel_rules_docker//container/go/...
DEBUG: /private/var/tmp/_bazel_zplin/d6323f9e3146540840037c805ccd73ff/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:68:14:
Current running Bazel is ahead of bazel-toolchains repo. Please update your pin to bazel-toolchains repo in your WORKSPACE file.
DEBUG: /private/var/tmp/_bazel_zplin/d6323f9e3146540840037c805ccd73ff/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:125:14: buildkite_config not using checked in configs; Bazel version 5.0.0 was picked/selected but no checked in config was found in map {"0.20.0": ["8.0.0"], "0.21.0": ["8.0.0"], "0.22.0": ["8.0.0", "9.0.0"], "0.23.0": ["8.0.0", "9.0.0"], "0.23.1": ["8.0.0", "9.0.0"], "0.23.2": ["9.0.0"], "0.24.0": ["9.0.0"], "0.24.1": ["9.0.0"], "0.25.0": ["9.0.0"], "0.25.1": ["9.0.0"], "0.25.2": ["9.0.0"], "0.26.0": ["9.0.0"], "0.26.1": ["9.0.0"], "0.27.0": ["9.0.0"], "0.27.1": ["9.0.0"], "0.28.0": ["9.0.0"], "0.28.1": ["9.0.0"], "0.29.0": ["9.0.0"], "0.29.1": ["9.0.0", "10.0.0"], "1.0.0": ["9.0.0", "10.0.0"], "1.0.1": ["10.0.0"], "1.1.0": ["10.0.0"], "1.2.0": ["10.0.0"], "1.2.1": ["10.0.0"], "2.0.0": ["10.0.0"], "2.1.0": ["10.0.0"], "2.1.1": ["10.0.0", "11.0.0"], "2.2.0": ["11.0.0"], "3.0.0": ["11.0.0"], "3.1.0": ["11.0.0"], "3.2.0": ["11.0.0"], "3.3.0": ["11.0.0"], "3.3.1": ["11.0.0"], "3.4.1": ["11.0.0"], "3.5.0": ["11.0.0"], "3.5.1": ["11.0.0"], "3.6.0": ["11.0.0"], "3.7.0": ["11.0.0"], "3.7.1": ["11.0.0"], "3.7.2": ["11.0.0"], "4.0.0": ["11.0.0"]}
ERROR: /Users/zplin/go/src/github.com/bazelbuild/rules_docker/container/go/cmd/digester/BUILD:31:10: While resolving toolchains for target //container/go/cmd/digester:digester: no matching toolchains found for types @io_bazel_rules_go//go:toolchain
ERROR: Analysis of target '//container/go/cmd/digester:digester' failed; build aborted:
INFO: Elapsed time: 0.152s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (13 packages loaded, 0 targets configured)
```

As a result, end-to-end tests cannot run on Apple Silicon either:

```
testing/e2e.sh test_container_pull_with_auth
"docker rmi" requires at least 1 argument.
See 'docker rmi --help'.

Usage: docker rmi [OPTIONS] IMAGE [IMAGE...]

Remove one or more images
9639f55a2c962719389fc290439ec41b9f583d7322397f20b1485ed47e5f2b86
Error: No such image: bazel/image:image
ERROR: /private/var/tmp/_bazel_zplin/aa79edc14e712d12745728305b89bbcc/external/io_bazel_rules_docker/container/go/cmd/join_layers/BUILD:19:10: While resolving toolchains for target @io_bazel_rules_docker//container/go/cmd/join_layers:join_layers: no matching toolchains found for types @io_bazel_rules_go//go:toolchain
ERROR: Analysis of target '@io_bazel_rules_docker//tests/container:push_test' failed; build aborted:
INFO: Elapsed time: 2.059s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (12 packages loaded, 669 targets configured)
FAILED: Build did NOT complete successfully (12 packages loaded, 669 targets configured)
```

### Describe the solution you'd like

Probably involving upgrading rules_go and some bug fixing in `testing/e2e.sh`.

### Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.