I'm hosting a Docker image inside of Google Container OS on Google Compute Engine. To deploy my container, I do this:
gcloud compute instances update-container example --container-image "$IMAGE_WITH_TAG"
On my latest deployment, I got this error:
failed to register layer: Error processing tar file(exit status 1): write /usr/share/man/man1/journalctl.1.gz: no space left on device
After SSHing into my Docker container, I ran docker images
and noticed that Docker was still hanging on to my old images. I can manually delete these images, but the same problem is going to occur after a few more deployments.
Is there a way I can automatically remove old Docker images while deploying to Container OS via gcloud compute instances update-container
?