skip to Main Content

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

2

Answers


  1. Chosen as BEST ANSWER

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

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

  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search