Can I write to the container's local filesystem from a Google Cloud Function? AWS Lambda allows writing to /tmp:
Q: What if I need scratch space on disk for my AWS Lambda function?
Each Lambda function receives 500MB of non-persistent disk space in its own /tmp directory.
Is there something equivalent in GCF?
Yes, /tmp is an in-memory mount. From https://cloud.google.com/functions/docs/concepts/exec#file_system:
File system
The only writeable part of the filesystem is the
/tmpdirectory, which you can use to store temporary files in a function instance. This is a local disk mount point known as a "tmpfs" volume in which data written to the volume is stored in memory. Note that it will consume memory resources provisioned for the function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With