Skip to content

docker-compose v2 not working with multiple configuration files #9294

@shadowspawn

Description

@shadowspawn

Description

I upgraded from Mac Docker Desktop 4.5.0 to 4.6.0 and some of my docker workflows broke. In a situation with services split across two configuration files and services in the second depending on services in the first, I now getting an error saying no such service: some-service-in-first.

Steps to reproduce the issue:

  1. Setup with multiple configurations files. Some services in file2 depend on services defined in file1.
  2. "Use Docker Compose V2" enabled in preferences
  3. run docker-compose -f file1 -f file2 run service-in-file2

Describe the results you received:

Error No such service: some-service-in-first. The actual service listed in the error varies.

Describe the results you expected:

Error free operation.

Additional information you deem important (e.g. issue happens only occasionally):

I tried unchecking "Use Docker Compose V2" in the preferences and it fixed the error.

The service listed in the No such service does vary.

The configuration files are using version: '2.3'. I am not sure that is significant, but thought it worth mentioning.

Output of docker compose version:

 % docker-compose --version
Docker Compose version v2.3.3

Output of docker info:

% docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.8.0)
  compose: Docker Compose (Docker Inc., v2.3.3)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 6
  Running: 1
  Paused: 0
  Stopped: 5
 Images: 135
 Server Version: 20.10.13
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  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 logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2a1d4dbdb2a1030dc5b01e96fb110a9d9f150ecc
 runc version: v1.0.3-0-gf46b6ba
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.10.104-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 6
 Total Memory: 15.64GiB
 Name: docker-desktop
 ID: I7EO:FMG4:UPPV:TSUZ:46GH:ZWQM:GJ6H:T5DN:TM2D:RR6Y:K6WJ:GL4K
 Docker Root Dir: /var/lib/docker
 Debug Mode: true
  File Descriptors: 45
  Goroutines: 49
  System Time: 2022-03-17T01:13:59.790909746Z
  EventsListeners: 5
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

Additional environment details:

Working with:
Mac Docker Desktop version 4.5.0.
Compose: v2.2.3

Problems with:
Mac Docker Desktop version 4.6.0.
Compose: v2.3.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions