Skip to content

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

@Evesy

Description

@Evesy

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions