compose icon indicating copy to clipboard operation
compose copied to clipboard

[BUG] Got services.NAME conflicts with imported resource after update from 2.21.0 to 2.24.1

Open ishkulov opened this issue 1 year ago • 0 comments

Description

I have configuration based on this example https://docs.docker.com/compose/multiple-compose-files/include/#example. There three files:

# postgresql.yml
version: '3'
services:
  postgres:
    image: postgres
# compose.yml
version: '3'
include:
  - postgresql.yml
# compose.override.yml
version: '3'
services:
  postgres:
    ports:
      - 5432:5432

With docker compose v2.24.1, it shows error:

$ docker compose version
Docker Compose version v2.24.1
$ docker compose config
services.postgres conflicts with imported resource

But it works well with v2.21.0:

$ docker compose version
Docker Compose version v2.21.0
$ docker compose config
name: compose
services:
  postgres:
    image: postgres
    networks:
      default: null
    ports:
    - mode: ingress
      target: 5432
      published: "5432"
      protocol: tcp
networks:
  default:
    name: compose_default

Steps To Reproduce

  1. Create directory with files above and run docker compose up (or config)

Compose Version

$ docker compose version
Docker Compose version v2.24.1

Docker Environment

$ docker info
Client: Docker Engine - Community
 Version:    25.0.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
  scan: Docker Scan (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-scan

Server:
 Containers: 2
  Running: 0
  Paused: 0
  Stopped: 2
 Images: 682
 Server Version: 25.0.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: a1496014c916f9e62104b33d1bb5bd03b0858e59
 runc version: v1.1.11-0-g4bccb38
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.1.0-17-amd64
 Operating System: Debian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 15.48GiB
 Name: ishkulov
 ID: V27O:S3O2:3SYQ:VHRF:HYQB:4CBG:APXI:JHXG:HFAX:CR4P:K5TG:AHMX
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

ishkulov avatar Jan 24 '24 23:01 ishkulov