Skip to content

fix: support compose.yml / compose.yaml as default compose file names - #1

Merged
us merged 3 commits into
us:mainfrom
kmplngj:main
Mar 8, 2026
Merged

fix: support compose.yml / compose.yaml as default compose file names#1
us merged 3 commits into
us:mainfrom
kmplngj:main

Conversation

@kmplngj

@kmplngj kmplngj commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

mocker compose only resolved docker-compose.yml as the default config file, ignoring the preferred filenames introduced in Docker Compose V2.

Changes

  • ComposeFile — adds defaultFileNames (ordered: compose.yaml, compose.yml, docker-compose.yaml, docker-compose.yml) and findDefault(in:) which returns the first match in a given directory, mirroring Docker Compose V2 lookup behaviour
  • ComposeOptions.file — changed from String = "docker-compose.yml" to String?; resolves via findDefault() when -f is not passed; error message now lists all searched filenames
  • Tests — 5 new cases covering priority order (compose.yaml > compose.yml > docker-compose.yaml > docker-compose.yml), fallback, and nil when none found
# Previously failed — now works
$ ls compose.yml
compose.yml
$ mocker compose up
[+] Running …

Copilot AI and others added 3 commits March 8, 2026 12:47
Co-authored-by: kmplngj <562965+kmplngj@users.noreply.github.com>
…ration

fix: support compose.yml / compose.yaml as default compose file names
@us
us merged commit 875ffd1 into us:main Mar 8, 2026
@us

us commented Mar 8, 2026

Copy link
Copy Markdown
Owner

thank you great catch! @kmplngj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants