File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -569,6 +569,14 @@ fn mounts(volumes: Vec<String>) -> anyhow::Result<Vec<Mount>> {
569
569
// resolve domains.
570
570
let resolv_mount = bind_mount ( "/etc/resolv.conf" , "/etc/resolv.conf" ) ?;
571
571
mounts. push ( resolv_mount) ;
572
+ // Mount the directory with SSH keys (`$HOME/.ssh`) to be able to access
573
+ // private repositories.
574
+ let home_dir = env:: var_os ( "HOME" ) . ok_or ( anyhow ! (
575
+ "cannot find the home directory, `HOME` environment variable is not defined"
576
+ ) ) ?;
577
+ let ssh_keys_dir = Path :: new ( & home_dir) . join ( ".ssh" ) ;
578
+ let ssh_keys_mount = bind_mount ( ssh_keys_dir, "/root/.ssh" ) ?;
579
+ mounts. push ( ssh_keys_mount) ;
572
580
// Mount all the user-provided volumes.
573
581
for volume in volumes {
574
582
let parts: Vec < & str > = volume. split ( ':' ) . collect ( ) ;
You can’t perform that action at this time.
0 commit comments