Docker machine can ssh but not scp

I started using the Docker Machine, and I just saw a scp command there. As the documentation says:

$ docker-machine ssh dev 'echo A file created remotely! >foo.txt' $ docker-machine scp dev:/home/docker/foo.txt .

I did the same by creating a file, and then:

docker-machine scp default:/home/docker/test.txt .

But I keep looking at state 1.

If I did the opposite and uploaded the file to the container, I ran into a lost connection with status 1. Command:

 docker-machine scp mongo.tar default:mongo.tar 

Please assume that I am not an expert on ssh and scp materials.

+5
source share
2 answers

if you use the docking machine from the Docker Toolbox on Windows, there is an automatically installed volume where you can access your host file system. The default mount point in the VM is / c / Users /.

+1
source

I ran into this problem yesterday and found a workaround (or solution?) Today. This applies to OS X Sierra and the latest Docker and VirtualBox at the time of this writing.

Navigating through docker Getting Started docs ( https://docs.docker.com/get-started/part4/#create-a-cluster ), the command:

 docker-machine scp docker-compose.yml myvm1:~ 

Returned immediately:

 Lost connection Exit Status 1 

Finally, I tracked it down to my / etc / ssh / ssh _config when I tried to run the classic scp command without binding the ssh dock. The scp command returned immediately, complaining of the following incompatible lines:

 GSSAPIKeyExchange no GSSAPITrustDNS no 

I commented on this, which eased the problem, and the scp dock was able to work as intended. I did not find this solution elsewhere.

Below are my system features. Hope this helps someone out there.

OS

OS X Sierra System Version: macOS 10.12.3 (16D32) Kernel Version: Darwin 16.4.0

Docker

Client: Version: 17.05.0-ce API version: 1.29 Go version: go1.7.5 Git commit: 89658be Built: Thu May 4 21:43:09 2017 OS / Arch: darwin / amd64

Server: Version: 17.05.0-ce API version: 1.29 (minimum version 1.12) Go version: go1.7.5 Git commit: 89658be Built: Thu May 4 21:43:09 PM OS / Arch: linux / amd64 Experimental: true

Virtualbox

Version 5.1.22 r115126

0
source

Source: https://habr.com/ru/post/1233840/


All Articles