How to get logs for docker maintenance tasks in preparation

Now I am playing with docker 1.12, created a service and noticed that there is a "preparing" step when I launched "docker service tasks xxx" .

I can only guess that at this stage the images are stretched or updated.

My question is: how can I see the magazines for this stage? Or more generally: how can I see the logs for docker service tasks?

+6
source share
2 answers

I use a docker machine to emulate different "hosts" in my development environment.

This is what I did to find out what is going on at this stage of the “Preparation” for my services:

docker service ps <serviceName>

You should see the nodes (machines) where your service was supposed to start. Here you will see the message "Preparation".

Use the ssh dock machine to connect to a specific machine:

 docker-machine ssh <nameOfNode/Machine> 

Your invitation will change. You are now inside another machine. Inside this other machine, do the following:

tail -f /var/log/docker.log

You will see a demon log for this machine. There you will see if this particular daemon does "pull" or what it does in preparation for the service. In my case, I found something like this:

time="2016-09-05T19:04:07.881790998Z" level=debug msg="pull progress map[progress:[===========================================> ] 112.4 MB/130.2 MB status:Downloading

Which made me realize that it was just downloading some images from my docker account.

+7
source

Your assumption (about stretching during preparation) is correct.

There is no log command for tasks yet, but you can probably connect to this daemon and make docker logs usual way.

+1
source

All Articles