update docker images to latest

Discussion room for Docker, a lightweight virtualization application that gives you the ability to run thousands of containers created by developers from all over the world on DSM
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/su ... p?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
desimaniac
Trainee
Trainee
Posts: 13
Joined: Sat Jun 29, 2013 4:21 pm

Re: update docker images to latest

Unread post by desimaniac » Thu Mar 30, 2017 12:35 am

sincarne wrote:
If that true why recommend what you recommend? You even test yourself?

Because this is a forum not the official Synology Knowledge Base, and as such, it is filled with experimental fixes and solutions. Everything here comes with the implied "do at your own risk". Yes, I'm using it and it's working as expected - updating all my containers and retaining my settings. I recommended it for people who'd find it useful as I did. And lo and behold it was useful for some one at least ... see below! In the end no one forced you to do it. So you can either not use it or provide another solution but your incessant crying about it just wastes everyone's time. Stop being a troll.




mightbetrue wrote:
<update>webhippie/watchtower is like 2 month old and can be convinced to use server api version 1.23:
docker run -d -e DOCKER_API_VERSION="1.23" -v /volume1/docker/docker.sock:/var/run/docker.sock webhippie/watchtower

Hint: /volume1/docker/docker.sock is a symlink to /var/run/docker.sock.

Actually it does do the trick! Now also the env variables are preserved. safely updated all my linuxserver.io containers to the latest image.
</update>
Nice find! Will try that out.*

*Although, centurylink/watchtower was preserving env's for me. The only thing it wasn't remembering was the website you can point the shortcut to. But I can just re-add that in, so not a big issue. But I will try your suggested version out nonetheless.

PS. don't bother with him/her, he/she is ungrateful and will give you non stop complaints.

PSS. As far as v2tec using a newer API, they have been made aware of it not working on Synology via an open GitHub issue and it's in their version 2.0 to do list to lower their API requirements.

PSS. You sure it's webhippie/watchtower and not allmende/watchtower? It seems allmende posted those changes in a pull request but webhippie hasn't commited them yet...

Update: It's not working with allmende/watchtower (logs are throwing errors), so it must be webhippie/watchtower.
Last edited by desimaniac on Thu Mar 30, 2017 2:05 am, edited 2 times in total.

sincarne
Guru
Guru
Posts: 1406
Joined: Wed Feb 15, 2017 9:57 pm

Re: update docker images to latest

Unread post by sincarne » Thu Mar 30, 2017 1:20 am

desimaniac wrote:
sincarne wrote:
If that true why recommend what you recommend? You even test yourself?

Because this is a forum not the official Synology Knowledge Base, and as such, it is filled with experimental fixes and solutions. Everything here comes with the implied "do at your own risk". Yes, I'm using it and it's working as expected - updating all my containers and retaining my settings. I recommended it for people who'd find it useful as I did. And lo and behold it was useful for some one at least ... see below! In the end no one forced you to do it. So you can either not use it or provide another solution but your incessant crying about it just wastes everyone's time. Stop being a troll.




mightbetrue wrote:
<update>webhippie/watchtower is like 2 month old and can be convinced to use server api version 1.23:
docker run -d -e DOCKER_API_VERSION="1.23" -v /volume1/docker/docker.sock:/var/run/docker.sock webhippie/watchtower

Hint: /volume1/docker/docker.sock is a symlink to /var/run/docker.sock.

Actually it does do the trick! Now also the env variables are preserved. safely updated all my linuxserver.io containers to the latest image.
</update>
Nice find! Will try that out.

PS. don't bother with him/her, he/she is ungrateful and will give you non stop complaints.

PSS. As far as v2tec using a newer API, they have been made aware of it not working on Synology via an open GitHub issue and it's in their version 2.0 to do list to lower their API requirements.

PSS. You sure it's webhippie/watchtower and not allmende/watchtower? It seems allmende posted those changes in a pull request but webhippie hasn't commited them yet...
i troll because you point out your solution no is good and broke everything? you very very rude! why you be such big jerk when I have to deal with your mistake?

y u lie about test? other user gave another solution which actually work and tested on synology. u test this on docker not on synology and that why it work? u and other poster both point out that docker API different on synology

desimaniac
Trainee
Trainee
Posts: 13
Joined: Sat Jun 29, 2013 4:21 pm

Re: update docker images to latest

Unread post by desimaniac » Thu Mar 30, 2017 1:37 am

sincarne wrote:
y u lie about test? other user gave another solution which actually work and tested on synology. u test this on docker not on synology and that why it work? u and other poster both point out that docker API different on synology


Image

Image

Image

.
.
.
.

You were saying....?

desimaniac
Trainee
Trainee
Posts: 13
Joined: Sat Jun 29, 2013 4:21 pm

Re: update docker images to latest

Unread post by desimaniac » Thu Mar 30, 2017 1:47 am

sincarne wrote:
i troll because you point out your solution no is good and broke everything? you very very rude! why you be such big jerk when I have to deal with your mistake?

y u lie about test? other user gave another solution which actually work and tested on synology. u test this on docker not on synology and that why it work? u and other poster both point out that docker API different on synology

I have a question for you: How much is Synology paying you? I hope that it's a good amount since you are doing a great job praising Synology for being lazy and not updating older software and trashing anyone who goes against anything they didn't come up with themselves.

Ignorance is bliss. Sigh.. I wish I could do what you can do, life would be so much easier :lol:

mightbetrue
Versed
Versed
Posts: 237
Joined: Sun Oct 02, 2016 9:41 am

Re: update docker images to latest

Unread post by mightbetrue » Thu Mar 30, 2017 6:39 am

desimaniac wrote: Nice find! Will try that out.*

*Although, centurylink/watchtower was preserving env's for me. The only thing it wasn't remembering was the website you can point the shortcut to. But I can just re-add that in, so not a big issue. But I will try your suggested version out nonetheless.

PS. don't bother with him/her, he/she is ungrateful and will give you non stop complaints.

PSS. As far as v2tec using a newer API, they have been made aware of it not working on Synology via an open GitHub issue and it's in their version 2.0 to do list to lower their API requirements.

PSS. You sure it's webhippie/watchtower and not allmende/watchtower? It seems allmende posted those changes in a pull request but webhippie hasn't commited them yet...

Update: It's not working with allmende/watchtower (logs are throwing errors), so it must be webhippie/watchtower.
Lucky you, that centurylink/watchtower did the trick for you :) It removed all my puid/pgid env variables for my linuxserver.io containers. Since I tried both images on two different instances, the observed behavior might be coincidental causal. Though, i will know once one of the images on the first box gets update, as i use webhippie/watchtower on both now.

I took a look at v2tec sources and their requirement for version 1.24 is hardcoded in the source.
It actualy has a DOCKER_API_VERSION variable, which is defined inside the go script itself. There are two other variables which specificly get their values from a system environment setting.. so there must be a reason why they made it like this.

Thanks for sharing your finding about watchtower!

desimaniac
Trainee
Trainee
Posts: 13
Joined: Sat Jun 29, 2013 4:21 pm

Re: update docker images to latest

Unread post by desimaniac » Thu Mar 30, 2017 10:12 am

mightbetrue wrote:
Thanks for sharing your finding about watchtower!
Thanks for giving it a try and reporting back :)

mightbetrue
Versed
Versed
Posts: 237
Joined: Sun Oct 02, 2016 9:41 am

Re: update docker images to latest

Unread post by mightbetrue » Thu Mar 30, 2017 8:11 pm

:)

<update>The containers on my first box, where the env variables have been removed while beeing updated by centurylink/watchtower had a successfull update today with webhippie/watchtower. Though, now the custom added env variables exist each additonaly (which won't do any harm) </update>

desimaniac
Trainee
Trainee
Posts: 13
Joined: Sat Jun 29, 2013 4:21 pm

Re: update docker images to latest

Unread post by desimaniac » Mon Jun 12, 2017 6:51 am

mightbetrue wrote::)

<update>The containers on my first box, where the env variables have been removed while beeing updated by centurylink/watchtower had a successfull update today with webhippie/watchtower. Though, now the custom added env variables exist each additonaly (which won't do any harm) </update>
Just thought of one thing that might help: Try specifying the puid/guid and other env in the docker command when you first create the docker container Perhaps then the updating will keep your environments.

mightbetrue
Versed
Versed
Posts: 237
Joined: Sun Oct 02, 2016 9:41 am

Re: update docker images to latest

Unread post by mightbetrue » Tue Aug 01, 2017 9:15 am

webhippie/watchtower stopped working because the docker client has the api version 1.24 and no way to provide the api version via environment variable (anymore?!), while our servers still use api version 1.23.
stffabi forked watchtower and repaced the hardcoded api version constant with the --apiversion runtime parameter.

Since our fancy Docker UI restricts access to shares, we need to provide an accessible symlink to the otherwise unaccessible docker.sock:

Code: Select all

ln -s /var/run/docker.sock /volume1/docker/docker.sock
Start the container passing the api version 1.23 from the shell:

Code: Select all

docker run -d -name watchtower \
  -v /volume1/docker/docker.sock:/var/run/docker.sock \
   stffabi/watchtower --apiversion 1.23

klogg
I'm New!
I'm New!
Posts: 7
Joined: Fri Jul 22, 2011 5:57 am

Re: update docker images to latest

Unread post by klogg » Sat Nov 18, 2017 1:24 am

mightbetrue wrote:DSM -> Docker -> Container -> menu-item "settings" -> import

Be sure to delete the container before you import the modified settings.
Thank you Riptide and mightbetrue! I screwed around with this forever and never found a reliable approach.

Re-downloading from the repository to update the image is the secret to getting the latest build, and then Export Settings -> stop and delete the current container -> Import Settings, gets the latest version while keeping all settings, ports, and container names so everything works exactly as before. Really appreciate the detailed steps.

mightbetrue
Versed
Versed
Posts: 237
Joined: Sun Oct 02, 2016 9:41 am

Re: update docker images to latest

Unread post by mightbetrue » Thu Nov 30, 2017 7:34 pm

mightbetrue wrote:webhippie/watchtower stopped working because the docker client has the api version 1.24 and no way to provide the api version via environment variable (anymore?!), while our servers still use api version 1.23.
stffabi forked watchtower and repaced the hardcoded api version constant with the --apiversion runtime parameter.

Since our fancy Docker UI restricts access to shares, we need to provide an accessible symlink to the otherwise unaccessible docker.sock:

Code: Select all

ln -s /var/run/docker.sock /volume1/docker/docker.sock
Start the container passing the api version 1.23 from the shell:

Code: Select all

docker run -d -name watchtower \
  -v /volume1/docker/docker.sock:/var/run/docker.sock \
   stffabi/watchtower --apiversion 1.23
On DSM6.1.4 with docker 17.05 the "--apiversion 1.23" is not required anymore. Also there is a missing dash in -name, it should be --name.
Still working flawless :)

psikoh
I'm New!
I'm New!
Posts: 1
Joined: Sun Dec 03, 2017 1:07 am

Re: update docker images to latest

Unread post by psikoh » Sun Dec 03, 2017 1:24 am

So, i just tried the stffabi/watchtower with this command

Code: Select all

docker run -d --name watchtower \
  -v /volume1/docker/docker.sock:/var/run/docker.sock \
   stffabi/watchtower
but after running and updating successfully the Images section is blank, and i can no longer use the GUI to download images/edit existing containers. Well, they download but don't show anything.

I had to cleanup all the old images before it would show again. I just googled it and used this and the images section now works properly

Code: Select all

docker images
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)


so the --cleanup option is needed to still use the GUI properly

Code: Select all

docker run -d --name watchtower \
  -v /volume1/docker/docker.sock:/var/run/docker.sock \
   stffabi/watchtower --cleanup

mightbetrue
Versed
Versed
Posts: 237
Joined: Sun Oct 02, 2016 9:41 am

Re: update docker images to latest

Unread post by mightbetrue » Sun Dec 03, 2017 12:40 pm

I do remember there was an oddity with rendering in one of the docker ui tabs with docker 17.05.x, though I didn't remember what caused it.

Actually --cleanup makes sense to get rid of the obsolete images.

Thanks for adding the info!

update: Watchtower removes the tag after updating an image (docker images shows those as "<empty>") . The Synology Docker UI should be able to handle those entries gracefuly, instead it shows no image at all.

Gentlemen, it's a bug in the Synology Docker UI!

Skar
Sharp
Sharp
Posts: 156
Joined: Wed Oct 25, 2006 2:43 pm

Re: update docker images to latest

Unread post by Skar » Wed Apr 18, 2018 12:04 pm

May I say, that after reading this thread, it seems relatively easy to do an container image update in CLI.

Yet the process for doing it in GUI seems more obtuse.

It would be useful for Synology to provide a way to repoint a container at an image (whether older or later) in a way that managed the process in a safe and constructive way. That handles the container repointing to the image id, whether that is a specific image or Latest.

Thanks to everyone who is commented, since it has proved a useful thread to read.

vanzano
I'm New!
I'm New!
Posts: 1
Joined: Wed May 16, 2018 6:33 pm

Re: update docker images to latest

Unread post by vanzano » Wed May 16, 2018 6:51 pm

riptide wrote:
Thu Aug 11, 2016 1:11 pm
I know that this is a quite old thread, but I wanted to share a solution for this problem using the DSM UI.

To update your containers with the latest image do the following:
1. Go to Registry and search for the image you want to update.
2. Right-click and choose to download the image (choose the same tag as your container uses). Wait for the download to complete.
3. Go to Containers and locate the container you want to update.
4. Right-click and choose Settings>Duplicate settings. Confirm to create the new container (you can change the name later).
5. Check the Details of your old image and write down the port settings (the new will be created with Auto port mapping).
6. Stop and Delete your old container.
7. Edit your new container to update the name and port mapping to mirror your old settings.
8. Start your new updated container.

This is how I managed to update my containers by only using the UI. Synology really need to implement a wizard/one-click option for this.

Using the Docker CLI it's much easier to update your containers.
0. If you don't have your "docker run" command saved, do a "docker inspect <container>" and find out what ports/volumes/links/networks/etc you need in your run command.
1. Update the image with "docker pull <image:tag>"
2. Stop and delete your container "docker rm -f <container>"
3. Start your container again "docker run -d --name <options> <image:tag>"

Always make sure that you save all your "docker run" commands in a file so you can start your containers easily again.
There's an easier way to do that:

1. Update the image with "docker pull <image:tag>"
2. Stop your container, right click it and select Action -> Clear

Image

Beware if you don't store your data outside your container as you should, it will wipe all the data within the container.

And thats it, start your container and you will be running the latest version.

Log:

Image

Post Reply

Return to “Docker”