Home > Blockchain >  docker cp cannot get exist file
docker cp cannot get exist file

Time:12-27

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

CodePudding user response:

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.

CodePudding user response:

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

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