从 Google Cloud Function 写入临时文件

Write temporary files from Google Cloud Function

我可以从 Google Cloud Function 写入容器的本地文件系统吗? AWS Lambda 允许写入 /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.

GCF 中是否有等效的东西?

是的,/tmp 是内存挂载。来自 https://cloud.google.com/functions/docs/concepts/exec#file_system:

File system

The only writeable part of the filesystem is the /tmp directory, 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.