|
|
@ -2,6 +2,7 @@ package commands
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"path/filepath"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
@ -124,7 +125,15 @@ func runBuild(dockerCli command.Cli, in buildOptions) error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
opts.Session = append(opts.Session, secrets)
|
|
|
|
opts.Session = append(opts.Session, secrets)
|
|
|
|
|
|
|
|
|
|
|
|
ssh, err := build.ParseSSHSpecs(in.ssh)
|
|
|
|
sshSpecs := in.ssh
|
|
|
|
|
|
|
|
if len(sshSpecs) == 0 {
|
|
|
|
|
|
|
|
defaultSock := os.Getenv("SSH_AUTH_SOCK")
|
|
|
|
|
|
|
|
if defaultSock != "" {
|
|
|
|
|
|
|
|
sshSpecs = []string{fmt.Sprintf("default=%s", defaultSock)}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ssh, err := build.ParseSSHSpecs(sshSpecs)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|