mount volume during docker build code example
Example 1: docker mount volume
docker run -v /host/directory:/container/directory -other -options image_name command_to_run
Example 2: docker build mount volume
$ docker run -it -v "$(pwd)/source_dir:/app/target_dir" ubuntu bash
# OR
$ docker run -it --mount "type=bind,source=$(pwd)/source_dir,target=/app/target_dir" ubuntu bash