TLDR: How to set expires_at
field for images created by publishing container?
I am trying to use LXD for testing purposes. My framework generates unique alias for image from source files and generates image for that alias. On next run, unless source files have not changed for container, the framework can reuse image and that makes tests execution much more faster. The problem with this approach I have is that it lefts unused local images. In general I need same expiration like there is for cached images. Initial idea was to convince LXD that that local image is cached one. The problem is how to do it without exporting it, modifying metadata and importing it. I also noticed that there another option that is available for not cached images and that is explicit expiration date. I can bump that date every time I use image so this can be easy enough replacement and LXD would manage my containers removal for me. Only problem is that I don’t see a way how to set that field. Modifying image using lxc edit
does not seem to do the trick or I am just not sure what key am I suppose to use. Can you please help me with this? How can I set explicit expiration date?
Possibly this can be also feature request. Could it be possible to have option for image to be removed automatically when it is not used for some time even when it is local one? Something like per-image settable expiration (something like there is for snapshots).