Error: path not specified when the docker 1.7 file is uploaded to the container in CentOS

I tried to find many ways to transfer files to the docker container on the Internet, and found a bug in version 1.7

docker cp e0ce13a27784:/home/website/default  /appuweichao/credit_ passport/web/

Error: Path not specified

The error message “error: path not specified” has been fixed in docker 1.8.0.

Error: path not specified

Solution: copy from the host to the container’s Mount directory

First, get the real ID of the container

docker inspect -f ‘{{.Id}}’ c37ca9beb746

cp /home/yulong/Downloads/file.txt /var/lib/docker/devicemapper/mnt/c37ca9beb7463630eddca6259bd26620cc60d413ae4869e1e0f96a21ad602155/rootfs/mnt

/var/lib/docker/devicemapper/mnt/c37ca9beb7463630eddca6259bd26620cc60d413ae4869e1e0f96a21ad602155/rootfs/mnt

This folder is actually a local shared folder where the container is mounted

Here are the folders for all the containers

c37ca9beb7463630eddca6259bd26620cc60d413ae4869e1e0f96a21ad602155

After entering the terminal/MNT, you can see it below file.txt It’s a document

 

Read More: