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

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now
  • 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": ""
            }
        ]