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?
Assuming I have the below, and a docker container running on my machine that exposes port
3000docker-compose.yml
Dockerfile
docker-compose buildsucceedsdocker buildx bakesucceeds when usingdocker-containerdriver with--driver-opt network=hostdocker buildx build --network=host .succeeds when using thedefaultbuilder/dockerdriverHowever
docker buildx bakefails when using thedefaultbuilder as it can't reachlocalhost:3000. It feels as though perhapsbuildx bakemight not be usingnetwork: hostspecified in thedocker-compose.ymlcorrectly?