Skip to content

[BUG] <extra_hosts array items[0,1] must be unique> #12155

@GuillaumeCisco

Description

@GuillaumeCisco

Description

Docker compose file is seen as invalid.

code is:

  foo:
    <<: *base
    container_name: foo
    build:
      context: ../foo
      <<: *docker-build-args
    command: [ 'nodemon', 'entrypoints/bugs' ]
    dns:
      - '8.8.8.8'
    dns_search: internal.namespace
    extra_hosts:
      - 'host.docker.internal:host-gateway'

Steps To Reproduce

$> docker compose version
Docker Compose version v2.29.6

error message:

validating /home/$USER/Projects/docker-compose.yml: services.foo.extra_hosts array items[0,1] must be unique

Compose Version

v2.29.6

Docker Environment

$> docker version
Client: Docker Engine - Community
 Version:           27.3.0
 API version:       1.47
 Go version:        go1.22.7
 Git commit:        e85edf8
 Built:             Thu Sep 19 14:25:51 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.3.0
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.7
  Git commit:       41ca978
  Built:            Thu Sep 19 14:25:51 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.22
  GitCommit:        7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
 runc:
  Version:          1.1.14
  GitCommit:        v1.1.14-0-g2c9f560
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Anything else?

Linked to #11371

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions