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 not honouring docker-compose build network mode host #848

Closed
Evesy opened this issue Nov 18, 2021 · 3 comments · Fixed by #863
Closed

buildx bake not honouring docker-compose build network mode host #848

Evesy opened this issue Nov 18, 2021 · 3 comments · Fixed by #863

Comments

@Evesy
Copy link

Evesy commented Nov 18, 2021

Assuming I have the below, and a docker container running on my machine that exposes port 3000

docker-compose.yml

version: '3.2'

services:
  app:
    image: "test-boolean2"
    restart: always
    user: root
    build:
      context: .
      network:
        host
      dockerfile: Dockerfile

Dockerfile

FROM centos:8

RUN curl http://localhost:3000
  • docker-compose build succeeds
  • docker buildx bake succeeds when using docker-container driver with --driver-opt network=host
  • docker buildx build --network=host . succeeds when using the default builder/docker driver

However docker buildx bake fails when using the default builder as it can't reach localhost:3000. It feels as though perhaps buildx bake might not be using network: host specified in the docker-compose.yml correctly?

@crazy-max
Copy link
Member

@Evesy

It feels as though perhaps buildx bake might not be using network: host specified in the docker-compose.yml correctly?

build.network does not seem to be part of the compose spec.

@Evesy
Copy link
Author

Evesy commented Nov 18, 2021

@crazy-max I may be mistaken but is this not it here?

@crazy-max
Copy link
Member

crazy-max commented Nov 18, 2021

@crazy-max I may be mistaken but is this not it here?

I'm blind sorry..

So to answer your question, no it's not taken into account by bake but I think we could add it.

zachary-povey pushed a commit to zachary-povey/buildx that referenced this issue Nov 25, 2021
Allows specification of network mode in a bake target.

Fixes docker#848

Signed-off-by: Zachary Povey <[email protected]>
zachary-povey pushed a commit to zachary-povey/buildx that referenced this issue Nov 25, 2021
Allows specification of network mode in a bake target.

Fixes docker#848

Signed-off-by: Zachary Povey <[email protected]>
zachary-povey pushed a commit to zachary-povey/buildx that referenced this issue Nov 25, 2021
Allows specification of network mode in a bake target.

Fixes docker#848

Signed-off-by: Zachary Povey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants