Score:1

View logs from short lived containers in docker stack

at flag

Similar to this question, but with the intricacies of the docker stack added.

While debugging short lived containers on vanilla docker is "easy", you just do docker logs -f "failed_container_id", how can I do the same for containers started via docker stack?

I tried the following but none work:

docker logs -f stackname_containername

docker logs -f stackname_containerid

docker logs -f containername

docker logs -f containerid

All of these attempts result in

Error response from daemon: No such container: XXXX

I also tried looking at the output of docker stack services stackname as suggested by my local friendly chatbot and using the service's id in the command docker service logs stackname_servicename but this just outputs nothing.

So how is it that I can see logs fine with "regular" docker containers but not with the ones started as part of a stack?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.