Skip to content

Commit 51456da

Browse files
committed
Pass env vars to docker
Based on #231 & closes #267
1 parent f31b4d9 commit 51456da

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ It is important that the host of your private repositories has already been adde
7272
`$HOME/.ssh/known_hosts` file, as the install process will fail otherwise due to host authenticity
7373
failure.
7474

75+
You can also pass all environment variables to the docker container by specifying the `dockerEnv`
76+
option:
77+
```yaml
78+
custom:
79+
pythonRequirements:
80+
dockerEnv: true
81+
```
82+
7583
[:checkered_flag: Windows notes](#checkered_flag-windows-dockerizepip-notes)
7684

7785
## Pipenv support :sparkles::cake::sparkles:

index.js

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class ServerlessPythonRequirements {
4242
dockerSsh: false,
4343
dockerImage: null,
4444
dockerFile: null,
45+
dockerEnv: false,
4546
useStaticCache: false,
4647
useDownloadCache: false,
4748
cacheLocation: false,

lib/pip.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function installRequirements(targetFolder, serverless, options) {
234234
])
235235
);
236236
}
237-
pipCmd = ['/bin/bash', '-c', '"' + commands.join(' ; ') + '"'];
237+
pipCmd = ['/bin/bash', '-c', '"' + commands.join(' && ') + '"'];
238238
} else {
239239
// Use same user so --cache-dir works
240240
cmdOptions.push('-u', quote_single(getDockerUid(bindPath)));

0 commit comments

Comments
 (0)