After trying docker cp from here, it still throws a Error: No such container:path:...
What am I doing wrong?
- The container is running
- I can run docker execcommands
- docker cpfails
After trying docker cp from here, it still throws a Error: No such container:path:...
What am I doing wrong?
docker exec commandsdocker cp fails 
    
     
    
    From the documentation:
The
docker cpcommand assumes container paths are relative to the container’s/(root) directory.
Source: https://docs.docker.com/engine/reference/commandline/cp/#extended-description
This means that, when your docker exec [CONTAINER] ls is affected by the WORKDIR, your docker cp is not.
What you should do from there is to run:
docker exec [CONTAINER] pwddocker cp command to have a fully qualified path to use in you docker cp commande.g. from the httpd image:
$ docker run -d --name httpd httpd
$ docker exec httpd pwd
/usr/local/apache2
$ docker exec httpd ls
bin
build
cgi-bin
conf
error
htdocs
icons
include
logs
modules
$ docker cp httpd:/usr/local/apache2/conf .
All this because the httpd image defines a WORKDIR on the folder /usr/local/apache2.
