docker / buildx

Docker CLI plugin for extended build capabilities with BuildKit
Apache License 2.0
3.5k stars 471 forks source link

bake: network host permission not allowed when linking targets #1138

Open brianthelion opened 2 years ago

brianthelion commented 2 years ago

The .hcl and .json interpreters support contexts: for resolving dependencies between builds.

The .yaml interpreter supports build: network: host to comply with the existing docker-compose spec.

None of the interpreters support both.

tonistiigi commented 2 years ago

When using target: linking the allow rule for network=host is not carried over to the linking target. This means you get error error: failed to solve: failed to load LLB: network.host is not allowed

tonistiigi commented 2 years ago

Workaround is to define network: host also to the target that is doing the linking. https://gist.github.com/tonistiigi/b5673cf524f6d701c2fe4bf5795753e3#file-gistfile2-txt

thompson-shaun commented 1 week ago

Might be fixed by https://github.com/docker/buildx/pull/2701