5

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.

Jiri Klouda
  • 5,867
  • 1
  • 22
  • 54
muhammad haris
  • 223
  • 2
  • 3

1 Answers1

5

According to the docs tmpfs is linux only.

RAM disk

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.

Jacob Vanus
  • 166
  • 2