简体   繁体   中英

docker cp cannot get exist file

Following is my code:

~ $ docker exec minikube ls /tmp
gvisor
h.876
h.951
hostpath-provisioner
hostpath_pv
nginx.tar
~ $ docker cp minikube:/tmp/nginx.tar /tmp/nginx.tar
Error: No such container:path: minikube:/tmp/nginx.tar

/tmp/nginx.tar exist in container but cannot cp, how to fix

Exec docker ps -a get container Id and use it in your command.

Then run docker cp {CONTAINER_ID}:/tmp/nginx.tar ~

~ is for your home directory, dont copy to temp directory its protected one.

I cannot fix docker cp err but I find another way to cp:

docker exec cat /tmp/nginx.tar > /tmp/nginx.tar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM