Skip to content

Commit f31b4d9

Browse files
committed
Merge remote-tracking branch 'galindro/master' into env
2 parents e06c829 + 343d769 commit f31b4d9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/pip.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,15 @@ function installRequirements(targetFolder, serverless, options) {
196196
pipCmd.push('--cache-dir', quote_single(dockerDownloadCacheDir));
197197
}
198198

199+
if (options.dockerEnv) {
200+
// Add environment variables to docker run cmd
201+
options.dockerEnv.forEach(
202+
function(item) {
203+
cmdOptions.push('-e', item);
204+
}
205+
);
206+
}
207+
199208
if (process.platform === 'linux') {
200209
// Use same user so requirements folder is not root and so --cache-dir works
201210
var commands = [];
@@ -225,7 +234,7 @@ function installRequirements(targetFolder, serverless, options) {
225234
])
226235
);
227236
}
228-
pipCmd = ['/bin/bash', '-c', '"' + commands.join(' && ') + '"'];
237+
pipCmd = ['/bin/bash', '-c', '"' + commands.join(' ; ') + '"'];
229238
} else {
230239
// Use same user so --cache-dir works
231240
cmdOptions.push('-u', quote_single(getDockerUid(bindPath)));

0 commit comments

Comments
 (0)