0

I create a GCP instance which runs automatically a docker image (gcloud beta compute instances create-with-container). Every time I reboot and there is a new image available, it is downloaded and executed, but the previous images stays "forever", until I run out of disk space.

Do I have to manually force the instance to prune old images?

1 Answer 1

0

These instances are nothing more but a COS (container optimized OS) with Docker installed. So, yes, you have to do it manually, just like if you would have your own VM with Docker installed.

Personally, I wouldn't want anything to be deleted from my VM automatically.

You can run the following command to achieve what you want:

docker image prune -a
2
  • They are something more, in the sense you specify in the instance metadata the image to be run, ENV variables and Volumes to mount. So it's weird they don't prune unused images automatically.
    – nunojpg
    May 4, 2018 at 10:26
  • Well, yes. But in the end it is translated into regular Docker commands, which is executed in the VM.
    – suren
    May 4, 2018 at 10:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .