docker run mount volume 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
$ docker run -it --mount "type=bind,source=$(pwd)/source_dir,target=/app/target_dir" ubuntu bash
Example 3: docker exec mount volume
docker run -v pwd:/container/directory -other -options image_name command_to_run
Example 4: start a docker container
$ docker start <container_id>