Skip to content

Commit 343d769

Browse files
author
Bruno Galindro da Costa
committed
Add environment variables to docker run cmd
1 parent b32f55b commit 343d769

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/pip.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,15 @@ function installRequirements(targetFolder, serverless, options) {
181181
pipCmd.push('--cache-dir', dockerDownloadCacheDir);
182182
}
183183

184+
if (options.dockerEnv) {
185+
// Add environment variables to docker run cmd
186+
options.dockerEnv.forEach(
187+
function(item) {
188+
cmdOptions.push('-e', item);
189+
}
190+
);
191+
}
192+
184193
if (process.platform === 'linux') {
185194
// Use same user so requirements folder is not root and so --cache-dir works
186195
var commands = [];
@@ -210,7 +219,7 @@ function installRequirements(targetFolder, serverless, options) {
210219
])
211220
);
212221
}
213-
pipCmd = ['/bin/bash', '-c', '"' + commands.join(' && ') + '"'];
222+
pipCmd = ['/bin/bash', '-c', '"' + commands.join(' ; ') + '"'];
214223
} else {
215224
// Use same user so --cache-dir works
216225
cmdOptions.push('-u', getDockerUid(bindPath));

0 commit comments

Comments
 (0)