Hi. I am running a container which is using alpine:3.10. I didn’t create a custom image, I used stock image available in lxd repository and modified a running container for my needs (installed nginx, added some php etc.). Now 3.10 is quite outdated and I wanted to upgrade it to 3.15. What is considered to be the most desirable approach in keeping container state up-to-date in terms of OS version. I can see the following options but not sure if it is a good approach:
- Create a custom image and upgrade that image when it is time to do so. Then I can delete old container and create a new one. It may work for stateless containers well. But not sure if it is a very convenient way for a database for example. I would need to backup it first and then restore from a backup.
- Upgrade distribution inside container. I haven’t tried it. But I believe container’s metadata will still show that this container is based on the old image. Can I manipulate that? If yes is it a good approach?
- Somehow do a snapshot of stateful folders of a container. Create a new container based on the latest image, apply snapshot. Delete old container. Is it possible to do? Is there any guide for that?