I am trying to copy file from docker container to host. I have attached the snapshot in which I listed all the containers as well as container file structure. But when I execute docker cp, it says it could not find the file. Can anyone tell me what wrong am I doing or if I am missing something. I am very new to docker so please guide me through.
            Asked
            
        
        
            Active
            
        
            Viewed 1,215 times
        
    0
            
            
        - 
                    When a container path is not absolute, it is assumed relative to the root `/` – yamenk Dec 04 '17 at 21:33
2 Answers
0
            I think you need to absolute path to the file inside the container. See the following.
Copying files from Docker container to host
docker cp <CONTAINER>:/<ABS_PATH>/procfile .
 
    
    
        Adam
        
- 3,992
- 2
- 19
- 39
0
            
            
        As documented for the docker cp command:
The docker cp command assumes container paths are relative to the container’s / (root) directory
Thus CONTAINER:file.txt is equivalent to CONTAINER:/file.txt as paths are interpreted relative to the root / 
 
    
    
        yamenk
        
- 46,736
- 10
- 93
- 87

