Docker Compose Tip #66: Volume drivers with NFS

Compose volumes default to local disk on the host running the container. When you need storage shared across hosts, a volume driver does the job. The built-in local driver already supports NFS through its options. Basic NFS mount Declare a volume that points to an NFS export: volumes: shared: driver: local driver_opts: type: nfs o: "addr=nfs-server.example.com,rw,nfsvers=4" device: ":/exports/shared" services: app: image: myapp volumes: - shared:/data The app service mounts /exports/shared from the NFS server at /data inside the container. Multiple containers (or even multiple Compose stacks on different hosts) can mount the same volume to share data. ...

May 22, 2026 · 3 min · 446 words · Guillaume Lours

Docker Compose Tip #35: Using tmpfs for ephemeral storage

Speed up I/O operations and enhance security by using tmpfs for temporary data. RAM-based storage that vanishes on restart! What is tmpfs? Tmpfs is a temporary filesystem that resides in memory: ⚡ Ultra-fast (RAM speed) 🔒 Secure (data doesn’t persist) 🧹 Self-cleaning (cleared on restart) Basic tmpfs usage Simple tmpfs mount: services: app: image: myapp tmpfs: - /tmp - /app/cache - /var/run With size limits: services: app: image: myapp tmpfs: - /tmp:size=100M - /app/cache:size=500M - /var/run:size=10M Advanced tmpfs options Fine-tuned configuration: ...

March 4, 2026 · 3 min · 524 words · Guillaume Lours