File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ custom:
26
26
pythonRequirements :
27
27
dockerizePip : true
28
28
` ` `
29
+ The dockerizePip option supports a special case in addition to booleans of ` ' non-linux' ` which makes
30
+ it dockerize only on non-linux environments.
31
+
32
+
29
33
To utilize your own Docker container instead of the default, add the following to your ` serverless.yml`:
30
34
` ` ` yaml
31
35
custom:
Original file line number Diff line number Diff line change @@ -20,13 +20,14 @@ class ServerlessPythonRequirements {
20
20
* @return {Object }
21
21
*/
22
22
get options ( ) {
23
- return Object . assign ( {
23
+ const options = Object . assign ( {
24
24
zip : false ,
25
25
cleanupZipHelper : true ,
26
26
invalidateCaches : false ,
27
27
fileName : 'requirements.txt' ,
28
28
usePipenv : true ,
29
29
pythonBin : this . serverless . service . provider . runtime ,
30
+ dockerizePip : false ,
30
31
dockerImage : `lambci/lambda:build-${ this . serverless . service . provider . runtime } ` ,
31
32
pipCmdExtraArgs : [ ] ,
32
33
noDeploy : [
@@ -40,8 +41,10 @@ class ServerlessPythonRequirements {
40
41
'pip' ,
41
42
'setuptools' ,
42
43
] ,
43
- } , this . serverless . service . custom &&
44
- this . serverless . service . custom . pythonRequirements || { } ) ;
44
+ } , this . serverless . service . custom && this . serverless . service . custom . pythonRequirements || { } ) ;
45
+ if ( options . dockerizePip === 'non-linux' )
46
+ options . dockerizePip = process . platform !== 'linux' ;
47
+ return options ;
45
48
}
46
49
47
50
/**
You can’t perform that action at this time.
0 commit comments