Open salmankavanur opened 6 months ago
Kindly describe your problem a bit more.
The users need to get a facility to update applications in docker containers within Cyberpanel without losing all the data. The only existing option is reinstalling but then all data is overwritten.
May i know are you talking about our new docker apps feature or the old one ?
I'm talking about the existing one. there's no update/upgrade feature for the existing containers. because most of the docker images will updated frequently by the developers. so we need to update in a single click instead of removing and reinstalling the docker images.
https://www.cherryservers.com/blog/how-to-update-docker-image
Is it safe to do so? As containers have to be deleted and recreated and could create issues for people not knowing what to do.
When we use the docker images like nextcloud, it's not possible or practical to do like this. to delete the image and recreate is not practical always.
It should be safe to remove and redeploy docker containers with new image versions. Docker were designed that way. You only need kind of general understanding what's going on to get along with that.
Any valuable data of the container could be persisted through volumes, which maps some machine disk folders into container's FS, therefore all data being written to the machine disk and only disappear if you don't bother to set such volumes up. But if you do, so even if you deleted container, and running new one with command or compose, you will get same volumes mapped inside new containers.
You may create persistent named volume as described there: https://docs.docker.com/storage/volumes/ You may map folder to container from comandline option -v /path/to/local/folder:/path/inside/container or -v volume-name:/path/inside/container You may use compose file and define volumes inside of it: https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference
There's no update or upgrade feature for docker containers without lossing existing data.