I am new to Docker and I want to run Docker with ram only storage. In other words, I do not want Docker to save anything on persistent storage. I found out that on Linux Docker supports tmpfs. Is there any such support for MacOS? I have tried setting --tmpfs flag and docker run commands run fine on mac with that flag.
According to the docs tmpfs is linux only.
If you want "RAM only storage", you can literally use a RAM disk. ie:
diskutil erasevolume HFS+ 'DockerDisk' `hdiutil attach -nomount ram://2097152 `
Then you can point volumes at
/Volumes/DockerDisk. Drop and recreate at will.
Docker will still store its VM and images on disk. See: Docker > Preferences > Disk.