Skip to content

Commit

Permalink
Fix new ddev auth ssh failure with Windows Docker Desktop by copying …
Browse files Browse the repository at this point in the history
…from mount instead of using it directly (#2539)
  • Loading branch information
rfay committed Oct 7, 2020
1 parent c55a0f1 commit b67a62f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/ddev/cmd/auth-ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var AuthSSHCommand = &cobra.Command{
util.Failed("This command takes no arguments.")
}

uidStr, _, username := util.GetContainerUIDGid()
uidStr, _, _ := util.GetContainerUIDGid()

if sshKeyPath == "" {
homeDir, err := homedir.Dir()
Expand Down Expand Up @@ -61,7 +61,7 @@ var AuthSSHCommand = &cobra.Command{
}
sshKeyPath = dockerutil.MassageWindowsHostMountpoint(sshKeyPath)

dockerCmd := []string{"run", "-it", "--rm", "--volumes-from=" + ddevapp.SSHAuthName, "--user=" + uidStr, "--mount=type=bind,src=" + sshKeyPath + ",dst=/home/" + username + "/.ssh", version.SSHAuthImage + ":" + version.SSHAuthTag + "-built", "ssh-add"}
dockerCmd := []string{"run", "-it", "--rm", "--volumes-from=" + ddevapp.SSHAuthName, "--user=" + uidStr, "--entrypoint=", "--mount=type=bind,src=" + sshKeyPath + ",dst=/tmp/sshtmp", version.SSHAuthImage + ":" + version.SSHAuthTag + "-built", "bash", "-c", `cp -r /tmp/sshtmp ~/.ssh && chmod -R go-rwx ~/.ssh && ssh-add`}

err = exec.RunInteractiveCommand("docker", dockerCmd)

Expand Down

0 comments on commit b67a62f

Please sign in to comment.