[docker] How to copy files from host to Docker container?

Where you don't have a directory defined as a volume in the Dockerfile, the /var/lib/docker/aufs/mnt// will work. But there are cases where the directory within the container is defined as a volume. In this case, the contents under aufs/mnt/*/ and the contents seen by the container are different.

You will need to inspect the container using docker inspect and then, look for volumes. There you will find a mention for something like /var/lib/docker/vfs/dir/fe940b... (the id). You will need to add/modify the files here instead of under aufs/mnt/*.

The confusing part is that the files also appear under /aufs/mnt/*. I spent quite a while scratching my head why changes here didn't work for me. Hope this helps someone.