From 2035453f13cde5df6efbfb07a9d6d1e602456eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Pa=C3=9Fberg?= Date: Thu, 6 Apr 2017 11:18:11 +0200 Subject: [PATCH] Run dockerized pip as invoking user By default docker executes commands in an container as root. This causes the downloaded dependencies to be owned by root. This messes up cleanup scripts. Using the correct object which holds the dockerizePip option. this.serverless.service.custom.dockerizePip Initialize the this.serverless.service.package.exclude and this.serverless.service.package.include correctly if they are not set. --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index bd141bf2..513f9fc5 100644 --- a/index.js +++ b/index.js @@ -43,6 +43,7 @@ class ServerlessPythonRequirements { ]; const dockerCmd = [ 'docker', 'run', '--rm', + '-u', process.getuid() + ':' + process.getgid(), '-v', `${this.serverless.config.servicePath}:/var/task:z`, 'lambci/lambda:build-python2.7', 'bash', '-c',