aws / aws/aws-sam-cli

Bug: `sam invoke start-api` doesn't mount sam artifacts on /var/task on Windows with Rancher Desktop

Open
#7,807 6 comments 0 reactions 0 assignees View on GitHub
stage/needs-investigation type/feature
Dominant language
Python
Stars
6.7k
Forks
1.2k
Avg merge
1d 10h
Merged PRs (30d)
52

Description

### Description:
Rancher Desktop seems to accept windows style path (C:\dir\to\.aws-sam\build\Function) in bind mounts.
However, `sam local start-api` creates container with unix-like path style (/c/dir/to/.aws-sam/build/Function) bindings which doesn't bind our artifact to host.

### Steps to reproduce:
1. install Rancher Desktop and start instead of Docker Desktop
2. create Hello World Example by `sam init`
3. `sam build` to create artifact
4. `sam local start-api` to start container with host artifact directory is bound to `/var/task`
5. see result of `docker container exec ls /var/task`

### Observed result:
nothing listed

### Expected result
files in `.aws-sam/build/HelloWorldFunction` listed

### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

```
{
"version": "1.132.0",
"system": {
"python": "3.12.6",
"os": "Windows-11-10.0.26100-SP0"
},
"additional_dependencies": {
"docker_engine": "26.1.5",
"aws_cdk": "Not available",
"terraform": "Not available"
},
"available_beta_feature_env_vars": [
"SAM_CLI_BETA_FEATURES",
"SAM_CLI_BETA_BUILD_PERFORMANCE",
"SAM_CLI_BETA_TERRAFORM_SUPPORT",
"SAM_CLI_BETA_RUST_CARGO_LAMBDA"
]
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.