Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to see errors from a container in community.docker.docker_compose_v2? #979

Open
mihalt opened this issue Oct 19, 2024 · 5 comments
Labels
docker-compose-v2 Docker Compose v2 question Further information is requested

Comments

@mihalt
Copy link

mihalt commented Oct 19, 2024

I would like not to ssh to my server with docker ps -a and after docker logs container_name each time when error occures in any container. And see them immidiately in ansible output. Is it possible?

@felixfontein felixfontein added question Further information is requested docker-compose-v2 Docker Compose v2 labels Oct 19, 2024
@felixfontein
Copy link
Collaborator

I'm not sure what exactly you need. A module which allows you to run docker logs <containername> for one / all containers for a service and/or project?

@felixfontein
Copy link
Collaborator

@mihalt can you please provide more details, for example how you would do this without Ansible?

@mihalt
Copy link
Author

mihalt commented Oct 25, 2024

I'm not sure what exactly you need. A module which allows you to run docker logs <containername> for one / all containers for a service and/or project?

For example I would like to have an option of you collection to choose one of this parameters of showing logs:

  1. Logs of first failled container with problems (by default)
  2. Show all failed containers log
  3. Show last failed container logs

Maybe something like this.

@felixfontein
Copy link
Collaborator

So which command do you run without Ansible to achieve this? The docker_compose_v2 module allows you to run commands like docker compose up, docker compose down, etc.

@mihalt
Copy link
Author

mihalt commented Oct 27, 2024

So which command do you run without Ansible to achieve this? The docker_compose_v2 module allows you to run commands like docker compose up, docker compose down, etc.

hmm, maybe docker compose logs, could be ok. But output is too big

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker-compose-v2 Docker Compose v2 question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants