EDIT 4: I've opened up an issue for this: https://issuetracker.google.com/issues/219164388
I'm using the Google Cloud Run emulator (glcoud beta code dev), and it works fine...
...until after I've used it for a few days, it has consumed all of the hard disk space that I've allotted to Docker (60 GB!) and fails to run anymore.
I then manually force-clear Docker's disk space using docker system prune --all --force --volumes.
Is there a way to tell gcloud to automatically clear out all the files it has written when shutting down the emulator?
Maybe a flag I'm missing? Or maybe I'm shutting down the wrong way? I'm currently stopping the emulator by ctrl+C from the terminal.
EDIT 3: As pointed out in the answer below, what I need is the equivalent of the docker --rm, but for gcloud.
EDIT: In case it helps, I think I have an idea of what's causing the fill-up:
I'm using GCR to serve a webpage, and in my Dockerfile. Every time I make changes, the gcloud emulator rebuilds the container. I think that with each rebuild, it's re-copying all the assets (images, audio), which is why it eats up so much disk space.
EDIT 2: Docker shows glcoud-local-dev as in-use even after I've ctrl+C shut down the emulator from the command line.