# create volume as destination docker volume create my-volume # create directory to copy mkdir my-dir echo "hello file1" > my-dir/my-file-1 # copy directory to volume copy-to-docker-volume my-dir my-volume # list directory on volume docker run --rm -it -v my-volume:/data busybox ls -la /data/my-dir # show file content on volume docker run --rm -it -v my-volume:/data busybox cat /data/my-dir/my-file-1 # create another fil to copy echo "hello file2" > my-file-2 # copy file to directory on volume copy-to-docker-volume my-file-2 my-volume my-dir # list (updated) directory on volume docker run --rm -it -v my-volume:/data busybox ls -la /data/my-dir # check volume content docker run --rm -it -v my-volume:/data busybox cat /data/my-dir/my-file-2