Skip to content

fix(compose): resolve relative volume paths to absolute before mounting#51

Merged
us merged 2 commits into
us:mainfrom
itxtoledo:fix/compose-relative-volume-mounts
Jul 1, 2026
Merged

fix(compose): resolve relative volume paths to absolute before mounting#51
us merged 2 commits into
us:mainfrom
itxtoledo:fix/compose-relative-volume-mounts

Conversation

@itxtoledo

Copy link
Copy Markdown
Contributor

Relative volume paths (./foo, ../bar, data/dir) in compose services were silently dropped because the volume filter only accepted sources starting with /.

What changed:

  • Extracted volume resolution into ComposeOrchestrator.resolveVolumeMounts() so it's testable
  • Relative paths are now resolved to absolute via URL(fileURLWithPath:) — matches Docker Compose's resolve-against-project-directory behavior
  • Named volumes (bare names, no path separators) remain skipped as before
  • Anonymous volumes (container-only paths) remain included

Tests: 9 new unit tests covering absolute, relative (./, ../), directory-separator paths, named volume skip, anonymous volume, mixed scenarios, read-only flag preservation, and home-relative paths.

Fixes #49

💘 Generated with Crush

itxtoledo and others added 2 commits June 30, 2026 13:16
Relative paths (./foo, ../bar, data/dir) in compose volumes were silently
dropped because the filter only accepted sources with a leading `/`. Resolve
them to absolute paths against the working directory, matching Docker Compose
behavior.

Fixes us#49

💘 Generated with Crush
Collapse three near-identical relative-path tests into one
@test(arguments:) case to remove duplicate assertion boilerplate.
@us us merged commit 5766189 into us:main Jul 1, 2026
1 check passed
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.

mocker compose up skips bind mounts with relative paths

2 participants