Skip to content

Commit 2035453

Browse files
author
Mike Paßberg
committed
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.
1 parent aa1d8ea commit 2035453

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class ServerlessPythonRequirements {
4343
];
4444
const dockerCmd = [
4545
'docker', 'run', '--rm',
46+
'-u', process.getuid() + ':' + process.getgid(),
4647
'-v', `${this.serverless.config.servicePath}:/var/task:z`,
4748
'lambci/lambda:build-python2.7',
4849
'bash', '-c',

0 commit comments

Comments
 (0)