aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

invalid bind mount spec

Open gkamdar opened this issue 9 years ago • 6 comments

When trying to invoke "HelloWorld" from Samples I get the following error. How do I fix it. Below is the output. I am running Docker Toolbox on Windows7.

C:\Users\gaurav_kamdar\go\src\github.com\awslabs\aws-sam-local\test\templates\sam-official-samples\hello_world>sam local invoke "HelloWorld" -e event.json 2017/08/24 14:20:25 Successfully parsed template.yaml ←[34mINFO←[0m[0000] Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows 2017/08/24 14:20:25 Connected to Docker 1.28 ←[34mINFO←[0m[0000] Unable to use system certificate pool: crypto/x509: system root pool is not available on Windows 2017/08/24 14:20:25 Fetching lambci/lambda:nodejs4.3 image for nodejs4.3 runtime... nodejs4.3: Pulling from lambci/lambda

←[1B84c367d8: Already exists ←[1Bf5aea2af: Already exists ←[1BDigest: sha256:fe7fd26840b4f06ba6626148f8bd234a6da21cd4fa2354dbc7c78be2d9bd5e3111kB/2.011kBB Status: Downloaded newer image for lambci/lambda:nodejs4.3 2017/08/24 14:20:26 Invoking index.handler (nodejs4.3) 2017/08/24 14:20:26 Could not invoke function: Error response from daemon: invalid bind mount spec "C:/Users/gaurav_kamdar/go/src/github.com/awslabs/aws-sam-local /test/templates/sam-official-samples/hello_world:/var/task:ro": invalid volume specification: 'C:/Users/gaurav_kamdar/go/src/github.com/awslabs/aws-sam-local/test /templates/sam-official-samples/hello_world:/var/task:ro'

gkamdar avatar Aug 24 '17 18:08 gkamdar

Are you using cygwin or git bash? Does this reproduce in cmd.exe or powershell?

Also, can you make sure C:/Users is in list of shared directories under Docker Toolbox?

sanathkr avatar Aug 27 '17 05:08 sanathkr

I'm facing the same problem on Windows 10 Home 2017/08/26 21:59:36 Could not invoke function: Error response from daemon: invalid bind mount spec "C:\Users\John\AppData\Local\Temp\aws-sam-local-1503781175721651700:/var/task:ro": invalid volume specification: 'C:\Users\John\AppData\Local\Temp\aws-sam-local-1503781175721651700:/var/task:ro' aws-sam-local-1503781175721651700 exists on the local file system, but I assume SAM local is writing to that

I'm using docker for the first time, so apologies if some of the responses are nonsense

I'm using git bash which was installed with the docker toolkit - I've tried cmd and powershell, but with both those I get

2017/08/27 10:06:53 Running AWS SAM projects locally requires Docker. Have you got it installed?

Is there a way of getting a list of shared directories from Docker Toolbox, all I could find in the docs was for listing shared directories in a container and the container is not running. VirtualBox for default has a folder of name c:/Users and path \?\c:\Users with auto-mount and full access.

JohnHoward9 avatar Aug 27 '17 09:08 JohnHoward9

I am having the same problem on Docker toolbox and windows 7.

deividi86 avatar Aug 31 '17 18:08 deividi86

I figured out that if you set --docker-volume-basedir \c\Users when invoking, it works.

deividi86 avatar Sep 20 '17 20:09 deividi86

Yeah, that's the solution. It is also documented in README file

sanathkr avatar Sep 21 '17 00:09 sanathkr

kudos

kaarthikeyansp avatar Nov 07 '17 05:11 kaarthikeyansp