Skip to content

Commit d74b1c0

Browse files
committed
Adds a dockerRunCmdExtraArgs option for adding arbitrary arguments to the dockerized pip step.
1 parent 2e81175 commit d74b1c0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class ServerlessPythonRequirements {
4848
dockerImage: null,
4949
dockerFile: null,
5050
dockerEnv: false,
51+
dockerRunCmdExtraArgs: [],
5152
useStaticCache: false,
5253
useDownloadCache: false,
5354
cacheLocation: false,

lib/pip.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,13 @@ function installRequirements(targetFolder, serverless, options) {
259259
// Use same user so --cache-dir works
260260
dockerCmd.push('-u', getDockerUid(bindPath));
261261
}
262+
263+
if (Array.isArray(options.dockerRunCmdExtraArgs)) {
264+
dockerCmd.push(...options.dockerRunCmdExtraArgs);
265+
} else {
266+
throw new Error('dockerRunCmdExtraArgs option must be an array');
267+
}
268+
262269
dockerCmd.push(dockerImage);
263270
}
264271

0 commit comments

Comments
 (0)