Open dhrimov opened 3 years ago
When using dockerized requirements, the docker run command is not correct. Older version (1.83.2) had the correct path like:
Serverless: Running docker run --rm -v C\:/Project/dhrimov/dhrimov-blog-lambdas/.serverless/test1/requirements\:/var/task\:z -v C:\\Users\\dmytr/.ssh/id_rsa\:/root/.ssh/id_rsa\:z -v C:\\Users\\dmytr/.ssh/known_hosts\:/root/.ssh/know n_hosts\:z -v undefined\:/tmp/ssh_sock\:z -e SSH_AUTH_SOCK\=/tmp/ssh_sock -u 0 lambci/lambda\:build-python3.6 python -m pip install -t /var/task/ -r /var/task/requirements.txt...
serverless.yml
sls deploy --stage dev
Installed version
Framework Core: 2.48.0 (local) Plugin: 5.4.2 SDK: 4.2.3 Components: 3.12.0
what fixed this for me was setting a env variable in my powershell by running $env:HOME=C:/Users/<user-name>
env
$env:HOME=C:/Users/<user-name>
When using dockerized requirements, the docker run command is not correct. Older version (1.83.2) had the correct path like:
```yaml service: dhrimov-blog-lambdas frameworkVersion: ">=2.48.0 <3.0.0" resources: Description: Lambdas that handle all blog interactions provider: stackName: ${opt:stage, self:provider.stage}-${self:service} stackTags: tier: ${opt:stage, self:provider.stage} managedBy: serverless name: aws runtime: python3.6 region: eu-central-1 stage: dev deploymentBucket: name: *** plugins: - serverless-plugin-git-variables - serverless-apigw-binary - serverless-offline - serverless-prune-plugin - serverless-python-requirements package: individually: true excludeDevDependencies: false exclude: - .tox/** - env/** - node_modules/** - "**/.coverage" - "**/__pycache__/**" - "**/env/**" - "**/tests/**" functions: dhrimov-blog-test1: handler: main.handler module: test1 name: ${opt:stage, self:provider.stage}-dhrimov-blog-test1 memorySize: 128 timeout: 10 description: ${self:service} events: - http: path: test1 method: get cors: true custom: prune: automatic: true number: 5 apigwBinary: types: - "*/*" pythonRequirements: zip: true dockerizePip: true dockerSsh: true useDownloadCache: false useStaticCache: false invalidateCaches: true ```serverless.yml
``` Serverless: Adding Python requirements helper to test1... Serverless: Adding Python requirements helper to test2... Serverless: Generated requirements from C:\Project\dhrimov\dhrimov-blog-lambdas\test1\requirements.txt in C:\Project\dhrimov\dhrimov-blog-lambdas\.serverless\test1\requirements.txt... Serverless: Installing requirements from C:\Project\dhrimov\dhrimov-blog-lambdas\.serverless\test1\requirements\requirements.txt ... Serverless: Docker Image: lambci/lambda:build-python3.6 Serverless: Running docker run --rm -v C\:/Project/dhrimov/dhrimov-blog-lambdas/.serverless/test1/requirements\:/var/task\:z -v **undefined/.ssh/id_rsa**\:/root/.ssh/id_rsa\:z -v undefined/.ssh/known_hosts\:/root/.ssh/known_hosts\:z -v undefined\:/tmp/ssh_sock\:z -e SSH_AUTH_SOCK\=/tmp/ssh_sock -u 0 lambci/lambda\:build-python3.6 python -m pip install -t /var/task/ -r /var/task/requirements.txt... Error --------------------------------------------------- Error: STDOUT: STDERR: docker: Error response from daemon: create undefined/.ssh/id_rsa: "undefined/.ssh/id_rsa" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host di rectory, use absolute path. See 'docker run --help'. at C:\Project\dhrimov\dhrimov-blog-lambdas\node_modules\serverless-python-requirements\lib\pip.js:331:13 at Array.forEach (sls deploy --stage dev
outputInstalled version