Skip to content

Commit

Permalink
Fix problem running "ddev auth ssh" from PS, fixes #1284 (#1296)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Nov 30, 2018
1 parent 7b3e79e commit ff16eab
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/ddev/cmd/auth-ssh.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmd

import (
"fmt"
"github.com/drud/ddev/pkg/ddevapp"
"github.com/drud/ddev/pkg/dockerutil"
"github.com/drud/ddev/pkg/exec"
Expand Down Expand Up @@ -60,12 +59,12 @@ var AuthSSHCommand = &cobra.Command{
util.Failed("Failed to start ddev-ssh-agent container: %v", err)
}
sshKeyPath = dockerutil.MassageWindowsHostMountpoint(sshKeyPath)
dockerCmd := fmt.Sprintf("docker run -it --rm --volumes-from=%s --mount 'type=bind,src=%s,dst=/tmp/.ssh' -u %s %s:%s ssh-add", ddevapp.SSHAuthName, sshKeyPath, uidStr, version.SSHAuthImage, version.SSHAuthTag)

err = exec.RunInteractiveCommand("sh", []string{"-c", dockerCmd})
dockerCmd := []string{"run", "-it", "--rm", "--volumes-from=" + ddevapp.SSHAuthName, "--user=" + uidStr, "--mount=type=bind,src=" + sshKeyPath + ",dst=/tmp/.ssh", version.SSHAuthImage + ":" + version.SSHAuthTag, "ssh-add"}
err = exec.RunInteractiveCommand("docker", dockerCmd)

if err != nil {
util.Failed("Docker command '%s' failed: %v", dockerCmd, err)
util.Failed("Docker command 'docker %v' failed: %v", dockerCmd, err)
}
},
}
Expand Down

0 comments on commit ff16eab

Please sign in to comment.