$ docker cp maven-container_:xxxx.war /home/wissem/Documents/docker-stage/wildfly-configured/target/
Error response from daemon: lstat
/var/lib/docker/aufs/mnt/afbdc7f4ce3165fb2e6c34929841b9fa911de1978887dd5b9b0804e4f624af2d /xxxx.war: no such file or directory
ERROR: Job failed: exit status 1
Issue the docker cp command and reference the container name or id. The first parameter of the docker copy command is the path to the file inside the container. The second parameter of the docker copy command is the location to save the file on the host.
Transfer a volume to another Docker hostFrom the extension, you can specify both the destination host the local volume copied to (for example, [email protected] ) and the destination volume. > SSH must be enabled and configured between the source and destination Docker hosts.
You need to copy from a running instance and not an image. So I assume maven-container_
is a name of the container your had launched and not a image. Also use complete path after :
,
docker cp maven-container_:/path/inside/container/xxxx.war /home/wissem/Documents/docker-stage/wildfly-configured/target/
I got this error when trying to copy a file under the root folder (seems related to @uthomas's answer).
$ docker cp dreamy_brown:/root/myfile.txt ~
Error: No such container:path: dreamy_brown:/root/myfile.txt
Solution: From within the container I first moved the file to the /tmp
folder:
$ mv /root/myfile.txt /tmp
and then I was able to copy it to the host:
$ docker cp dreamy_brown:/tmp/myfile.txt ~
For me it didn't work because of permissions. The file I was trying to copy was owned by postgres user, while the default user seems to be root.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With