Skip to content

Commit 50992c0

Browse files
committed
Mount the entire user SSH directory into build container
This enables the user to use an key file format (RSA, ED25519, ...). Additionally, it allows more complex workflows (such as different SSH keys for specfic sites, such as Github or Bitbucket), since the .ssh/config file is also mounted into the container. Fixes #488
1 parent 6ecc5ad commit 50992c0

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ custom:
7171
dockerSsh: true
7272
```
7373

74-
The `dockerSsh` option will mount your `$HOME/.ssh/id_rsa` and `$HOME/.ssh/known_hosts` as a
74+
The `dockerSsh` option will mount your `$HOME/.ssh/` directory as a
7575
volume in the docker container. If your SSH key is password protected, you can use `ssh-agent`
7676
because `$SSH_AUTH_SOCK` is also mounted & the env var set.
7777
It is important that the host of your private repositories has already been added in your

lib/pip.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,7 @@ function installRequirements(targetFolder, serverless, options) {
201201
if (options.dockerSsh) {
202202
// Mount necessary ssh files to work with private repos
203203
dockerCmd.push(
204-
'-v',
205-
`${process.env.HOME}/.ssh/id_rsa:/root/.ssh/id_rsa:z`,
206-
'-v',
207-
`${process.env.HOME}/.ssh/known_hosts:/root/.ssh/known_hosts:z`,
204+
`${process.env.HOME}/.ssh/:/root/.ssh/:z`,
208205
'-v',
209206
`${process.env.SSH_AUTH_SOCK}:/tmp/ssh_sock:z`,
210207
'-e',

0 commit comments

Comments
 (0)