Skip to content

failed to find target default when running docker compose build with buildx version v0.26.0 #3328

@davidsawicki

Description

@davidsawicki

Contributing guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

docker compose build just started failing with the error:

failed to find target default

after docker-buildx was upgraded from v0.25.0 to v0.26.0.

I tested this out on a minimal Dockerfile and docker-compose.yml file (see Configuration below). When switching between the binaries buildx-v0.25.0.linux-amd64 and buildx-v0.26.0.linux-amd64 retrieved from https://github.com/docker/buildx/releases/download/v0.25.0/buildx-v0.25.0.linux-amd64, I observed the regression described in Actual behaviour below.

Expected behaviour

From v0.25.0:

[+] Building 0.1s (5/5) FINISHED                                                                           
 => [internal] load local bake definitions                                                            0.0s
 => => reading from stdin 341B                                                                        0.0s
 => [internal] load build definition from Dockerfile                                                  0.0s
 => => transferring dockerfile: 78B                                                                   0.0s
 => [internal] load .dockerignore                                                                     0.0s
 => => transferring context: 2B                                                                       0.0s
 => exporting to image                                                                                0.0s
 => => writing image sha256:7a6f0b0314399295ae69295416baf73a6f64df002c67f419a4612fc9f76b52a2          0.0s
 => => naming to docker.io/library/tmp-my-service                                                     0.0s
 => resolving provenance for metadata file                                                            0.0s
[+] Building 1/1
 ✔ my-service  Built

Actual behaviour

From v0.26.0:

[+] Building 0.0s (1/1) FINISHED                                                                           
 => [internal] load local bake definitions                                                            0.0s
 => => reading from stdin 341B                                                                        0.0s
failed to find target default

Buildx version

github.com/docker/buildx v0.26.0 5c7e114

Docker info

Client:
 Version:    28.3.2-1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.26.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.38.2
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 3
 Server Version: 28.3.2-1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
 runc version: bc20cb4497af9af01bea4a8044f1678ffca2745c
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.8.0-1027-azure
 Operating System: Ubuntu 20.04.5 LTS (containerized)
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.62GiB
 Name: codespaces-1057e7
 ID: 7a96023c-6d18-44ca-b8ab-ce1bf201da32
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: codespacesdev
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false

Builders list

NAME/NODE     DRIVER/ENDPOINT   STATUS    BUILDKIT   PLATFORMS
default*      docker                                 
 \_ default    \_ default       running   v0.23.2    linux/amd64 (+3), linux/386

Configuration

Dockerfile:

FROM scratch
CMD ["echo", "Hello world"]

docker-compose.yml:

services:
  my-service:
    build:
      context: .
      dockerfile: Dockerfile

Build logs

[+] Building 0.0s (1/1) FINISHED                                                                           
 => [internal] load local bake definitions                                                            0.0s
 => => reading from stdin 341B                                                                        0.0s
failed to find target default

Additional info

Note: The above is being run inside a GitHub Codespaces container. I don't know whether this is also a problem outside of GitHub Codespaces.

Metadata

Metadata

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions