"You must have a copy of the scp binary locally to use the scp feature"

I’m working my way through the “Define and deploy applications” tutorial on Windows 10 but when I get to the step where I must transfer a local Windows file to one of the docker machines using scp I am blocked as the scp command does not seem to work for me. I just get the error: “You must have a copy of the scp binary locally to use the scp feature”.

I did some searching and am not seeing anyone else having reported this so I’m wondering if I’m doing something wrong or if maybe the latest build I was upgraded to (Version 17.03.0-ce-win1 (10296)) earlier this week may have broken that.

The command line below should just work right?
docker-machine scp ~/docker2/docker-stack.yml manager:/home/docker/.

Has anyone else seen this issue?

Any help or nudge in the right direction would be greatly appreciated as I am now blocked.

Thanks,
Ben

Hi, I have exactly the same issue. I was following the tutorial here https://docs.docker.com/engine/getstarted-voting-app/deploy-app/ and stumbled upon the issue while trying to deploy docker-stack.yml to the host machine.
I also have win 10 and the latest docker version.

I was not able to resolve this. I was able to continue with the tutorial by opening up a vi editor window and pasting the file in but that won’t always work. And it certainly won’t work when building automaton scripts.

I got around this problem by downloading the docker-stack.yml file from the docker machine:

docker-machine ssh manager
cd /home/docker/
wget https://raw.githubusercontent.com/docker/example-voting-app/master/docker-stack.yml --no-check-certificate

1 Like

I ran into this as well. Looks like this is a problem for Docker for Windows, as I understood the error message to mean you need the scp tool to make it work, which is a Linux library not available on Windows.

I used scp from another Linux VM with access to my file to get around it. You could also download PuTTY on Windows and use pscp (Windows port of scp) to transfer the file. Use the commands directly and not through docker-machine, something like,

pscp docker-compose.yml docker@<VM_ip_address>:/home/docker/docker-compose.yml

The docker user default password was tcuser when I did it. You can find the VM ip address by running ifconfig on the VM and checking eth0 interface inet addr field, or just run docker-machine ls.

1 Like

If you happen to have Git for Windows installed, docker-machine scp will run successfully in Git Bash.

4 Likes

I tried javacraft’s solution and run successfully, and find the way to run in Power Shell.

STEP 1: Install Git for Windows.
STEP 2: Append the following PATH.(C:\Program Files\Git\usr\bin)

5 Likes

It Works!.. just adding path to …Git\usr\bin … where scp.exe is … to the PATH environment variable.
Thanks.

Here’s another way to get SSH tools for Windows: https://github.com/PowerShell/Win32-OpenSSH/releases

This was great help and great idea - thanks!

Download Docker Tools and Install
Go into Environment Variables and add to PATH C:\Program Files\Git\usr\bin
Restart PowerShell
Change command in Powershell to:
docker-machine scp /c/docker/docker-compose.yml myvm1:~

SCP cannot read the : in the windows path, you must approach it like Linux
/c/docker/docker-compose.yml would be c:\docker\docker-compose.yml edit accordingly

0
down vote
I got around this by using the Putty scp program called pscp.exe that I already had installed.

(initially I tried to rename ‘pscp’ to ‘scp’, but that doesn’t work because docker engine uses the -o option to send SSH commands. ‘pscp’ doesn’t have the -o option.)

You can use pscp on the command line directly. First find out the IP address of the VM:

docker-machine env <VM_name>
VM name in your case is ‘manager’. Take the ip address (without port) out of the $Env:DOCKER_HOST variable. Eg:

$Env:DOCKER_HOST = "tcp://192.168.XXX.XXX:2376"
Then use pscp to send the file:

pscp <file_to_send> docker@<ip_address_of_VM>:/home/docker/foo.txt
You will be prompted for the password of the ‘docker’ user. I found that docker uses a default password ‘tcuser’ which worked when I did it.

yeeeeeaaaahhhhhssss!!! thank you!

This worked…

Thank you very much !!!

Thank you. After setting the Git variable and restarting my terminal, the scp issue resolved.

Why I can’t solve this issue. Actually I get password prompt when tried to execute command “docker-machine scp docker-compose.yml myvm1:~”


but I don’t know password. May be anybody knows default password for virtual machine, that was created by docker.

Thank you for default password.

Thank you a lot. Your answer works.