docker / compose

Define and run multi-container applications with Docker
https://docs.docker.com/compose/
Apache License 2.0
34k stars 5.23k forks source link

[BUG] Build fails with Bad File Descriptor #12050

Closed dipanghosh closed 1 month ago

dipanghosh commented 3 months ago

Description

Running docker compose build

fails with bad file descriptor

I managed to track down this issue to the buildx plugin of docker. See this buildx issue and this pull request. However, I have downgraded buildx to 15.1, and docker compose build still fails. Docker build works after the downgrade.

Steps To Reproduce

Trying to build a container, while on a NFS is likely causing the issue.

Run docker compose build

Compose Version

Docker Compose version v2.29.1
docker-compose not installed

Docker Environment

Client: Docker Engine - Community
 Version:    27.1.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.15.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 15
  Running: 13
  Paused: 0
  Stopped: 2
 Images: 33
 Server Version: 27.1.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2bf793ef6dc9a18e00cb12efb64355c2c9d5eb41
 runc version: v1.1.13-0-g58aa920
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.1.0-23-amd64
 Operating System: Debian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 31.3GiB
 Name: services
 ID: d106e603-8eb2-486e-82a3-51976dee2d5a
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

I downgraded compose to version 2.28.1, at which point the errors were resolved.

glours commented 3 months ago

Hey @dipanghosh

Compose is vendoring buildx which explains why even if you downgrade buildx version you still have the issue with Compose. This will be fixed on the Compose side when we'll bump buildx version with the fix included

dipanghosh commented 3 months ago

Ah I see. That makes sense.

Thanks for the clarification. Once the new version comes, I will close the issue.

SJaffa commented 2 months ago

I'm getting this too, is there an estimate for when it will be fixed, or a workaround if that is a while away? I have Docker version 27.1.1 and Docker Buildx version 0.16.1

SJaffa commented 1 month ago

Fixed for me by upgrading to Docker version 27.2.1 with buildx v0.16.2

glours commented 1 month ago

@dipanghosh can we close this issue? do you still have troubles with lates releases of Compose?

dipanghosh commented 1 month ago

I have not checked myself, but i believe it to be resolved.