Docker Desktop for Mac OSCatalina Mount SD Card Volume in Container as loop device to flash SD Card with dd Docker Desktop for Mac OSCatalina Mount SD Card Volume in Container as loop device to flash SD Card with dd docker docker

Docker Desktop for Mac OSCatalina Mount SD Card Volume in Container as loop device to flash SD Card with dd


I think this will work:

docker run -v /dev:/dev --privileged YOURIMAGE bash

then :

dd if=/dev/random of=/dev/disks2

you need also to share /dev in your docker configurations , and I think it is some how risky to share it beside using the --privileged parameters .....

you will get the following message if you do not share /dev:

docker: Error response from daemon: Mounts denied:The path /dev/disk1s2is not shared from OS X and is not known to Docker.You can configure shared paths from Docker -> Preferences... -> File Sharing.See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.