Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how get logs for docker service tasks on "preparing" state

I'm playing around now with docker 1.12, created a service and noticed there is a stage of "preparing" when I ran "docker service tasks xxx".

I can only guess that on this stage the images are being pulled or updated.

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

like image 469
Shay Tsadok Avatar asked Jul 18 '16 20:07

Shay Tsadok


1 Answers

I have been using docker-machine for emulating different "hosts" in my development environment.

This is what I did to figure out what was going on during this "Preparing" phase for my services:

docker service ps <serviceName>

You should see the nodes (machines) where your service was scheduled to run. Here you'll see the "Preparing" message.

Use docker-machine ssh to connect to a particular machine:

docker-machine ssh <nameOfNode/Machine>

Your prompt will change. You are now inside another machine. Inside this other machine do this:

tail -f /var/log/docker.log

You'll see the "daemon" log for that machine. There you'll see if that particular daemon is doing the "pull" or what's is doing as part of the service preparation. 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 realise that it was just downloading some images from my docker account.

like image 186
cSn Avatar answered Nov 19 '22 01:11

cSn