Skip to content

Commit 9b7ec5a

Browse files
committed
Create docker command only if necessary, partially adresses #21
1 parent 6174a1d commit 9b7ec5a

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

index.js

+7-8
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,14 @@ class ServerlessPythonRequirements {
4141
'pip', '--isolated', 'install',
4242
'-t', '.requirements', '-r', 'requirements.txt',
4343
];
44-
const dockerCmd = [
45-
'docker', 'run', '--rm',
46-
'-u', process.getuid() + ':' + process.getgid(),
47-
'-v', `${this.serverless.config.servicePath}:/var/task:z`,
48-
'lambci/lambda:build-python2.7',
49-
];
5044
if (this.custom.dockerizePip) {
51-
cmd = dockerCmd[0];
52-
options = dockerCmd.slice(1);
45+
cmd = 'docker';
46+
options = [
47+
'run', '--rm',
48+
'-u', process.getuid() + ':' + process.getgid(),
49+
'-v', `${this.serverless.config.servicePath}:/var/task:z`,
50+
'lambci/lambda:build-python2.7',
51+
];
5352
options.push(...pipCmd)
5453
} else {
5554
cmd = pipCmd[0];

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-python-requirements",
3-
"version": "2.1.1",
3+
"version": "2.1.2",
44
"engines": {
55
"node": ">=6.0"
66
},

0 commit comments

Comments
 (0)