Docker - cannot mount volume over existing file, file exists
Suppose you are under Linux, run the following code
docker run -it --rm -v /local_dir:/image_root_dir/mount_dir image_name
Here is some detail:
-it: interactive terminal --rm: remove container after exit the container-v: volume or say mount your local directory to a volume
Since the mount function will 'cover' the directory in your image, your should always make a new directory under your images root directory.
Visit official documentation Use bind mounts to get more information.