Access to raw disk device in Docker container on Mac Access to raw disk device in Docker container on Mac docker docker

Access to raw disk device in Docker container on Mac


For ubuntu 18LTS running on a lenovo SE350,the following command worked like a charm for me:

docker run --rm -it --privileged --device=/dev/sda:/dev/sda  gdisk:latest bash

I believe this did the magic

--privileged --device=/dev/sda:/dev/sda