Skip to content

fix: docker volume and bind mount resolution#1859

Open
DomiIRL wants to merge 2 commits intoCloudNetService:nightlyfrom
DomiIRL:feat/docker-mounts
Open

fix: docker volume and bind mount resolution#1859
DomiIRL wants to merge 2 commits intoCloudNetService:nightlyfrom
DomiIRL:feat/docker-mounts

Conversation

@DomiIRL
Copy link
Copy Markdown

@DomiIRL DomiIRL commented Apr 27, 2026

Motivation

Currently the volume and bind definitions in the task and docker configuration have a few issues:

  • Volume definitions are passed directly to the Docker API, which results in anonymous volumes instead of properly using an existing named volume or creating the intended one
  • Binds are mounted on the same relative path on both the host and container side, based on the working directory, which limits valid mount setups and prevents different host and container locations
  • Allowing relative bind paths can also cause conflicts, since the working directory is already mounted in the container and should not be reused for bind resolution

Modification

  • Added proper parsing for Docker mount definitions so volumes and bind mounts are handled separately
  • Changed bind handling to require explicit paths instead of resolving them relative to the working directory
  • Updated volume handling so configured volumes are no longer converted into anonymous Docker volumes
  • Kept the mount handling strict to avoid path conflicts and invalid relative definitions

Result

  • Volume definitions now behave as intended and are handled as proper Docker volumes
  • Bind mounts can now use distinct host and container paths
  • Relative bind paths are no longer accepted, which avoids conflicts with the already mounted working directory
  • Mount handling is now more predictable and matches the configuration semantics more closely

Examples

The updated parsing follows Docker short syntax more closely while maintaining backwards compatibility with old behavior

For Volumes:

Definition Parsed as Source Target Read-only
/data Anonymous volume null /data false
my-volume:/data Named volume my-volume /data false
my-volume:/data:ro Named volume my-volume /data true

For Binds:

Definition Source Target Read-only
/data /data /data false
/host/data:/data /host/data /data false
/host/data:/data:ro /host/data /data true
C:\data:/data C:\data /data false
C:\data:/data:readonly C:\data /data true

Before

image

After

image

@DomiIRL DomiIRL changed the title fix: improve docker volume and bind mount resolution fix: docker volume and bind mount resolution Apr 27, 2026
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.

1 participant