Copying files with docker-machine scp creates invalid content

hi there,

i wrote a simple shell script to setup a server with docker-machine.
there are two config files (aws credentials) that i need to copy to the remote machine, but running
docker-machine scp /path/to/host/config machine:/path/to/remote/config
breakts the file content - the file is getting created, but the content is invalid.

running the command outside the shell script instead works as expected - the files are created on the remote machine and the content is valid.

as i am new to linux and docker i have no clue what the problem could be, help appreciated.

thanks in advance for any help

Although this will may cause you another problem ā€“ unpacking a tar file on the remote machine from your script ā€“ bundling your files into a tar file and coping the tar file to your remote machine may be a good solution.

I tried to copy a whole /etc/apache2 configuration to a remote machine using docker-machine scp, with the -r (recursive) flag set. It copied the file links as full files. Iā€™m not sure the scp in docker-machine functions the same as the Linux scp command line tool, so, using a tried-and-true tar file (in conjunction with docker-machine scp) worked better.

thats a good idea tom, ill try this out.

nevertheless i will file an issue on github for the initial problem. in my greenhorn eyes it makes no sense that the same command works fine outside a shellscript, but fails within one.

After debugging a little bit I found out the docker scp command works fine and the files get corrupted after reboot of my server via docker-machine. So my initial problem has nothing todo with docker-scp