Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker cp Path not specified

Tags:

docker

copy

I trying copy a folder to my container but not working. If I try

sudo docker cp 4aefd670e41f:/var/www/html/web2015 /home/desarrollo3/proyectos/web2015 

The folder web2015 copy correct but I need copy the folder in my container.

Working ok

sudo docker cp 4aefd670e41f:/var/www/html/web2015 /home/desarrollo3/proyectos/web2015

Not Working

sudo docker cp /home/desarrollo3/proyectos/web2015 4aefd670e41f:/var/www/html/web2015

Aditional info Docker

Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.3.3
Git commit (client): 7c8fca2
OS/Arch (client): linux/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.3.3
Git commit (server): 7c8fca2
OS/Arch (server): linux/amd64

I've Ubuntu 15

The error FATA[0000] Error: Path not specified

sudo docker cp /home/desarrollo3/proyectos/web2015 4aefd670e41f:/var/www/html/web2015

If I write this, I don't get errors but not copy nothing:

sudo docker cp ./folder:web2015 4aefd670e41f:/var/www/html/
like image 262
Jordi Salom Avatar asked Mar 13 '23 04:03

Jordi Salom


1 Answers

If it is a folder that you need to copy, make sure SRC_PATH ends with / (considering DEST_PATH on the container does exist already)

sudo docker cp /home/desarrollo3/proyectos/web2015/ 4aefd670e41f:/var/www/html/web2015

docker cp mentions:

SRC_PATH does end with /.

the content of the source directory is copied into this directory.

As shown in issue 13171, the error message "Error: Path not specified" was fixed in docker 1.8.0 (commit 5e86b81).
Docker 1.6.2 is way too old.

like image 101
VonC Avatar answered Mar 24 '23 03:03

VonC