Skip to content

CLI: Volume Parsing Differences Between WSLC and Docker #14432

Closed

Description

@AmelBawa-msft

Volume Parsing Differences Between WSLC and Docker

Reference: wslc container run --volume

The current volume parser in WSLC is a lightweight implementation based on right-to-left (RTL) parsing. While it works well for common scenarios, it does not fully support all syntax variations currently accepted by Docker. Some of these gaps may be intentional, depending on how we choose to handle edge-case behavior.

Additionally, the parser currently allows container creation even though startup ultimately fails. Ideally, it should detect such situations earlier and return a descriptive error message before attempting to create the container.


Edge Cases That Fail in Both WSLC and Docker (Different Failure Reasons)

Although the final error surfaces from service code, the parser in WSLC produces different intermediate inputs compared to Docker.

"C:\hostPath:/containerPath:invalid_mode"
  - Docker fails because 'invalid_mode' is not a valid mode.
  - WSLC fails with ERROR_PATH_NOT_FOUND.

"C:\hostPath:/containerPath:ro:extra"
  - Docker fails due to too many colons.
  - WSLC fails with ERROR_PATH_NOT_FOUND.

"C:\hostPath:/containerPath:"
  - Docker fails because the mode is empty.
  - WSLC fails with ERROR_PATH_NOT_FOUND.

Edge Cases That Fail Only in WSLC (But Succeed in Docker)

It is currently unclear whether WSLC should support these cases (CC: Craig Loewen (@craigloewen-msft), Blue (@OneBlue)).

"C:\hostPath"
  - Docker interpretation: 'C:\hostPath' → 'C:\hostPath'

"C:/hostPath"
  - Docker interpretation: 'C:/hostPath' → ('C:' → 'hostPath')

":"
  - Docker interpretation: ':' → ':'

"::"
  - Docker interpretation: '::' → '::'

"test"
  - Docker interpretation: 'test' → 'test'

Next Steps

The existing RTL parser is intentionally lightweight and sufficient for most scenarios today. However, if broader Docker compatibility becomes a goal, we could consider implementing a more robust parser that:

  • Syntactically supports a larger subset of Docker volume syntax.
  • Semantically aligns with Docker’s parsing behavior.
  • Ensures the service layer receives consistent and correct inputs.

This would help reduce divergence in error handling and improve overall compatibility.

Activity

  1. github-actions commented on Mar 14, 2026

    @github-actions
  2. craigloewen-msft commented on Mar 17, 2026

    @craigloewen-msft
    Member

    It is currently unclear whether WSLC should support these cases

    What are these exact cases?

    The following things look identical to me so I'm not sure what's being asked:

    "C:\hostPath"
      - Docker interpretation: 'C:\hostPath' → 'C:\hostPath'
    
    "C:/hostPath"
      - Docker interpretation: 'C:/hostPath' → ('C:' → 'hostPath')
    
    ":"
      - Docker interpretation: ':' → ':'
    
    "::"
      - Docker interpretation: '::' → '::'
    
    "test"
      - Docker interpretation: 'test' → 'test'
    
  3. microsoft-github-policy-service commented on Mar 24, 2026

    @microsoft-github-policy-service
    Contributor

    This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue.

    Thank you!

  4. dkbennett commented on Oct 9, 2026

    @dkbennett
    Member

    verify if this has been fixed

  5. ggarzia-MSFT commented on Oct 12, 2026

    @ggarzia-MSFT
    Contributor

    This is not fixed. Regarding the original issue description, confirmed with Blue (@OneBlue) that we want to match Docker's behavior regarding edge cases.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions