Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildx bake complains about undefined default network #906

Closed
hiimdoublej-swag opened this issue Jan 7, 2022 · 2 comments · May be fixed by #1803
Closed

buildx bake complains about undefined default network #906

hiimdoublej-swag opened this issue Jan 7, 2022 · 2 comments · May be fixed by #1803

Comments

@hiimdoublej-swag
Copy link

My compose file is like this

version: "3"
services:
  test:
    build: .
    networks:
    - default

The default network here is okay, even though it's not defined in a network .
docker-compose up does just fine and no errors.
However, if I try docker buildx bake -f docker-compose.yml, it will complain about the "undefined" network.

[+] Building 0.0s (0/0)
error: service "test" refers to undefined network default: invalid compose project

IMHO the default network should've been fine since

  1. It is the default network created when using docker compose.
  2. Running docker-compose up on the same file doesn't show an error, proving that it is a valid compose file.

So I think this is a bug ? If it is please do let me know how I can be helpful to get this fixed. Thanks.

@hiimdoublej-swag
Copy link
Author

Just recognized that this is more of an issue with compose-go rather than buildx.
I've created a new issue there. compose-spec/compose-go#216
This issue is considered closed.

@ndeloof
Copy link
Contributor

ndeloof commented May 16, 2023

This issue is caused by bake intentionally skipping the compose model normalization:
https://github.com/docker/buildx/blob/master/bake/compose.go#L39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants