0

Everyone. I'm running Docker

Client:
 Version:      1.8.2
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   0a8c2e3
 Built:        Thu Sep 10 19:19:00 UTC 2015
 OS/Arch:      linux/amd64

Server:
 Version:      1.8.2
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   0a8c2e3
 Built:        Thu Sep 10 19:19:00 UTC 2015
 OS/Arch:      linux/amd64

on

 Kernel Version: 3.16.0-53-generic 
 Operating System: Ubuntu 14.04.2 LTS

since few weeks and everything seems fine. I'm able to pull containers for the registry and run them without issues.

Now I wish to use Watchtower to automate their refresh. However, I have a hard time doing so. First, I have tried to run Watchtower as states in the README

docker run -d \
  --name watchtower \
  -v /var/run/docker.sock:/var/run/docker.sock \
  centurylink/watchtower

but after the creation of a new image on Docker Hub and waiting for the default 5 minutes nothing happened.

So I try to access the Watchtower container to see if everything was fine but when I run docker run -t -i centurylink/watchtower /bin/bash I get

FATA[0000] Get http://unix.sock/v1.15/containers/json?all=0&size=0: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

The file unix /var/run/docker.sock exists and the user is a member of the docker group

user@server1:/$ grep 'docker' /etc/group docker:x:999:user

UPDATE 1 - See comment

If I run docker logs container-id-of-watcher-container I get

user@server1:~$ docker logs 504ba2eb37fd
time="2016-04-18T06:54:30Z" level=info msg="Checking containers for updated images"
time="2016-04-18T06:59:30Z" level=info msg="Checking containers for updated images"
time="2016-04-18T07:04:30Z" level=info msg="Checking containers for updated images"
time="2016-04-18T07:09:30Z" level=info msg="Checking containers for updated images"
time="2016-04-18T07:14:30Z" level=info msg="Checking containers for updated images"
time="2016-04-18T07:19:30Z" level=info msg="Checking containers for updated images"
time="2016-04-18T07:24:30Z" level=info msg="Checking containers for updated images"
time="2016-04-18T07:29:30Z" level=info msg="Checking containers for updated images"

UPDATE 2

I found the issue. I should use the container name and not the image name when scoping Watchtower to a single image.

However, now the question is. How can I update private images?

Thanks.

Dominik
  • 2,283
  • 1
  • 25
  • 37
Sig
  • 5,476
  • 10
  • 49
  • 89
  • If you want to get into a running container, use ˙docker exec˙ not docker run – user2915097 Apr 18 '16 at 05:04
  • don't you see a running container after performing docker run -d \ --name watchtower \.. ? For me it seems to work. – lvthillo Apr 18 '16 at 06:22
  • @lorenzvth7 The container is running but after a new image is created on Docker Hub is not refreshed. – Sig Apr 18 '16 at 06:38
  • @macsig what do you get when you perform 'docker logs container-id-of-watcher-container' ? – lvthillo Apr 18 '16 at 06:44
  • @lorenzvth7 see update to the post. Thanks – Sig Apr 18 '16 at 07:40
  • @macsig seems to be normal. Now you have to run a container from an own image of yourself which is on dockerhub. After updating your own image you'll see an update of your container – lvthillo Apr 18 '16 at 09:47
  • you'll see in the logs that your watcher is looking every 5 minutes to see if an image on dockerhub is updated. – lvthillo Apr 18 '16 at 09:49
  • Thanks for your help. I have decided not to use Watchtower. – Sig Apr 19 '16 at 02:59

1 Answers1

0

Glad you figured it out!

I just posted about how you may use private registries as an answer to this question:

Watchtower maintainer and developer here. We actually do have support for using private registries. This is done by using a fully qualified name as the image name, ie. example.com/my-org/my-image:my-tag, as well as mounting config.json at the watchtower container root.

See the docs, specifically https://containrrr.github.io/watchtower/usage-overview/

The docs could probably be clearer, and if you feel up for the task, feel free to improve them once you get it working.

simme
  • 1,514
  • 12
  • 23