Create Volume
docker volume create <volume_name>
2. Verify volume
docker volume ls
3. Create service and attach volume mount
docker service create --name <servicename> --replicas 2 --mount src=<name_of_volume>,dst=<destination_of_path> <name_of_docker_image>
4. Inspect volume
docker inspect <volume_name>
Last updated 2 years ago