Skip to content

[BUG] "docker-compose config" consumes huge amounts of memory with broken config #12235

@ahollmann

Description

@ahollmann

Description

docker-compose config with the following config consumes huge amounts of memory. I had to SIGTERM it with ctrl-c in order not to run out of memory.

The config is obviously broken as services: is missing.

I'm using docker-compose config to verify if the config is correct so it seems to be valid use case.

Version used: Docker Compose version v2.29.7

x-healthcheck: &healthcheck
  healthcheck:
    test: [ "CMD", "wget", "--quiet", "--spider", "--timeout=1", "http://localhost:9000/health/live" ]
    start_period: 20s
    start_interval: 1s
    interval: 30s
    timeout: 2s
    retries: 5


  egress-service:
    <<: *healthcheck

Steps To Reproduce

Create compose.yaml with the input

x-healthcheck: &healthcheck
  healthcheck:
    test: [ "CMD", "wget", "--quiet", "--spider", "--timeout=1", "http://localhost:9000/health/live" ]
    start_period: 20s
    start_interval: 1s
    interval: 30s
    timeout: 2s
    retries: 5


  egress-service:
    <<: *healthcheck

run: docker-compose config

Compose Version

Docker Compose version v2.29.7

Docker Environment

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

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions