what is tempfs in docker volume and how it use it?

  • This is in-memory file system
  • Tt will not be seen anywhere in the host/container filesystem
  • This volume cannot be shared among containers
  • Once container is stopped/restarted stored info will be lost
  • It is recommended to use for high speed temporary storage
# command to run container with tmpfs volume
docker run -itd --name ezhil4 --mount type=tmpfs,destination=/opt/tmpfs ubuntu

# docker inspect of tmpfs container, there will be no source for tmpfs
 "Mounts": [
            {
                "Type": "tmpfs",
                "Source": "",
                "Destination": "/opt/tmpfs",
                "Mode": "",
                "RW": true,
                "Propagation": ""
            }
        ]