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

Can't build containers on macOS after upgrade to 0.23.0 #2009

Open
eikemeier opened this issue Jan 28, 2022 · 9 comments
Open

Can't build containers on macOS after upgrade to 0.23.0 #2009

eikemeier opened this issue Jan 28, 2022 · 9 comments

Comments

@eikemeier
Copy link

🐞 bug report

Affected Rule

The issue is caused by the rule: java_image

Is this a regression?

Yes, the previous version in which this bug was not present was: 0.22.0

Description

When building a simple Java Docker image on macOS, the build fails with “No matching toolchains found”. It works on Linux, since the target and host platforms are identical.

🔬 Minimal Reproduction

See https://github.com/eikemeier/java-container

🔥 Exception or Error


bazel build //src/main/java/com/example/hello_world:hello_world_image
[...]
ERROR: [...]/java-container/src/main/java/com/example/hello_world/BUILD:16:11: While resolving toolchains for target //src/main/java/com/example/hello_world:hello_world_image.binary: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. [...]

🌍 Your Environment

Operating System:

  
macOS Catalina 10.15.7
  

Output of bazel version:

  
5.0.0
  

Rules_docker version:

  
0.23.0
  

Anything else relevant?

See also #1988 (comment)

@dragonsinth
Copy link
Contributor

Same for go_image; 0.22.0 works, 0.23.0 doesn't. According to git bisect, seems to be introduced in:
Transition container image target platform (#1963) 76c708f

@pcmoritz
Copy link

Same for py3_image, 0.22.0 works and 0.23.0 doesn't. Hopefully this can be fixed soon :)

@psalaberria002
Copy link

Is anyone looking into this issue? Any workaround other than going back to 0.22?

@shs96c
Copy link

shs96c commented Mar 24, 2022

We've had to prepare a cross-compiling C toolchain to use on macOS in order to make this work. Ultimately, we picked one based on musl, since that's most likely to work on most linux variants, but we've also had to patch rules_go to force go_binary to statically link when building for a docker image. Getting this working properly has been a pretty significant piece of work.

If anyone is following in our footsteps, we started off from musl-cross-make

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

@github-actions github-actions bot added the Can Close? Will close in 30 days unless there is a comment indicating why not label Sep 21, 2022
@kylekurz
Copy link

I don't think this is closable, I'm still locked to 0.22 waiting on a fix for this.

@github-actions github-actions bot removed the Can Close? Will close in 30 days unless there is a comment indicating why not label Sep 22, 2022
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

@github-actions github-actions bot added the Can Close? Will close in 30 days unless there is a comment indicating why not label Mar 22, 2023
@kylekurz
Copy link

As before, this is still an unaddressed issue and should not be closed.

@github-actions github-actions bot removed the Can Close? Will close in 30 days unless there is a comment indicating why not label Mar 23, 2023
@trungdinhth
Copy link

With py3_image, for 0.25 we are still having this problem.

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

7 participants