Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

windows7 sp1 > docker-machine scp doesn't work: exit status 1 (usage) #4302

@boly38

Description

@boly38

Hi
I'm trying to do some basics: scp a given file onto a fresh new docker instance.

I don't understand what's wrong. I'm under windows 7 SP1 / windows git bash.
(I was trying the same under cmd.exe with same result)

Here is the step to reproduce for me using git bash:

$ export PATH=/c/Programmes/DockerToolbox/:/c/Programmes/Git/bin/:/c/Programmes/Git/usr/bin/

$ git --version
git version 2.15.0.windows.1

$ docker-machine version
docker-machine.exe version 0.13.0, build 9ba6da9

$ /c/Programmes/VirtualBox/VBoxManage.exe --version
5.2.0r118431

$ cd /c/tempo

$ docker-machine create default
# it works!
# (...)
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: C:\Programmes\DockerToolbox\docker-machine.exe env default


$ docker-machine.exe ls
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER        ERRORS
default   -        virtualbox   Running   tcp://192.168.99.100:2376           v17.10.0-ce

$ eval "$(docker-machine env default)"

$ docker-machine.exe ssh default
# it works!

$ echo SimpleFile > myFile

$ docker-machine scp myFile default:
usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2
exit status 1

What is really confusing is that when I'm doing the same stuff with debug mode, docker-machine is providing the command used. And this one works!

$ docker-machine --debug scp myFile default:
Docker Machine Version:  0.13.0, build 9ba6da9
Found binary path at C:\Programmes\DockerToolbox\docker-machine.exe
Launching plugin server for driver virtualbox
Plugin server listening at address 127.0.0.1:59450
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
(default) Calling .GetSSHPort
(default) Calling .GetSSHKeyPath
(default) Calling .GetSSHKeyPath
(default) Calling .GetSSHKeyPath
(default) Calling .GetSSHHostname
(default) Calling .GetSSHUsername
{C:\Programmes\Git\usr\bin\scp.exe [C:\Programmes\Git\usr\bin\scp.exe -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -3 -o IdentitiesOnly=yes -o Port=59393 -o IdentityFile="C:\\Users\\myuserhere\\.docker\\machine\\machines\\default\\id_rsa" myFile [email protected]:] []  <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> <nil> false [] [] [] [] <nil> <nil>}
usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2
exit status 1


$ C:\\Programmes\\Git\\usr\\bin\\scp.exe -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -3 -o IdentitiesOnly=yes -o Port=59393 -o IdentityFile="C:\\Users\\myuserhere\\.docker\\machine\\machines\\default\\id_rsa" myFile [email protected]:
myFile                                                 100%   11     6.3KB/s   00:00        
# it works!

The only diff is the "\" in the binary path ("\\" expected)

After reading some close issue, I got same status with the following attempt:

$ MYSYS_NO_PATHCONV=1 docker-machine scp localhost:./myFile default:/home/docker
usage: scp [-346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2
exit status 1

do you know how to fix that ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions