File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,13 @@ custom:
33
33
pythonRequirements:
34
34
dockerizePip: true
35
35
` ` `
36
+ To utilize your own Docker container instead of the default, add the following to your `serverless.yml` :
37
+ ` ` ` yaml
38
+ custom:
39
+ pythonRequirements:
40
+ dockerImage: <image name>:tag
41
+ ` ` `
42
+ This must be the full image name and tag to use, including the runtime specific tag if applicable.
36
43
37
44
38
45
# # Dealing with Lambda's size limitations
Original file line number Diff line number Diff line change @@ -67,11 +67,15 @@ class ServerlessPythonRequirements {
67
67
}
68
68
if ( this . custom ( ) . dockerizePip ) {
69
69
cmd = 'docker' ;
70
+
71
+ const image = this . custom ( ) . dockerImage || `lambci/lambda:build-${ runtime } ` ;
72
+ this . serverless . cli . log ( "Docker Image: " + image )
73
+
70
74
options = [
71
75
'run' , '--rm' ,
72
76
'-u' , process . getuid ( ) + ':' + process . getgid ( ) ,
73
77
'-v' , `${ this . serverless . config . servicePath } :/var/task:z` ,
74
- `lambci/lambda:build- ${ runtime } ` ,
78
+ `${ image } ` ,
75
79
] ;
76
80
options . push ( ...pipCmd ) ;
77
81
} else {
You can’t perform that action at this time.
0 commit comments