OpenMediaVault-Plugin-Developers / openmediavault-docker-gui

Docker plugin for OpenMediaVault
32 stars 17 forks source link

Update button for containers #33

Open reey opened 7 years ago

reey commented 7 years ago

A button which allows to update a container to it's newest version would be great. So if you click the button, you will: -pull the latest version of the image. -stop the old container -create a new container with the new image and the same options the older container started with Optional: remove the old image and container (maybe keep them for a while if there are some problems with the newer version..)

I think that would be a great feature.

nicjo814 commented 7 years ago

This is already implemented for the linuxserver containers on the Repo tab of the plugin. It's only possible to update a container when there is a newer version available. This functionality is only available since linuxserver publishes their own information when a contanier is updated.

I don't think there is a general way to achieve this functionality for other containers though since I don't know of any way to get info for when a container is updated on the Docker hub.

reey commented 7 years ago

I thought we could use the docker hub api for that? https://docs.docker.com/v1.4/reference/api/docker-io_api/

nicjo814 commented 7 years ago

Last time I checked (quite some time ago now) there was no method that would show when an image was pushed to the hub. It might have changed since then but after a quick look at the docs I still can't find this info in any method.

reey commented 7 years ago

If we would compare the image id of our last pull with the ids we are getting by GET /v1/repositories/(namespace)/(repo_name)/images and dont't find the id anymore or it is no longer at the top of the response, than there should be a new version.. Or am I wrong?

nicjo814 commented 7 years ago

A bit late reply, but I think you're on to a possible solution. Much (all?) of the stuff required is already implemented for the linuxserver.io containers (there is an update button for those) so it should be possible to use your comparison and then "reuse" the existing code for "upgrading" a running container. I won't be able to code this myself due to lack of time, but I would be willing to assist if you feel like investigating this further. I think it would be a very nice addition to the feature set of the plugin.

reey commented 7 years ago

Maybe I will find some time at the weekend to have a look at the code ;)

b0mb commented 7 years ago

Hi!

Are there any news?

I love the plugin but it really needs an update mechanism. ;)

luxflow commented 7 years ago

https://github.com/v2tec/watchtower use this

jtcmedia commented 6 years ago

@luxflow that's a good solution. Only problem is the accumulation of stale, old images. There's a --cleanup option for watchtower but it doesn't work when you put it in the 'Extra Arguments' in the plugin GUI for the container.

ase1590 commented 5 years ago

Really though, If we're just going to use Watchtower to update containers, why even have this plugin for OMV? not being able to update the containers from the UI by manually clicking a button seems silly.