Specific docker log does not appear in terminal logs

Sorry, I’m not sure I can follow you. The code snippet doesn’t make sense to me. If compose really shows the exit code and the the output twice that alone is weird bug that I can’t explain, but you say that both of your commands were the same with -d, but it is not in your code snippet. Also there is only “backend-1” in the output and not “wait”. And the whole point of passing -d is that there is no output in the same terminal and you can only get the output if you run a docker compose logs command for example.

Then you also wrote previously

Which I can’t understand either. What do you call terminal command? You can run a docker compose command in a terinal and that terminal will be where the output can appear or not. And of course anywhere where you get the logs like in Docker Desktop. And every time you have a single container that echos a single line should be a single output, not two, not three.

I even tried your files that you shared and could not reproduce any of the weird behaviours.

The only thing that comes to my mind is how python handles output which I wrote about here:

But that has nothing to do with how the docker commands show their own output and how many times that appears.

If you can share the all the files you used to reproduce the issue, I can try., but so far I fail to understand what you are doing exactly.

And please, also follow the guide in the below question template to learn more about your environment:


We usually need the following information to understand the issue:

  1. What platform are you using? Windows, Linux or macOS? Which version of the operating systems? In case of Linux, which distribution?

  2. How did you install Docker? Sharing the platform almost answers it, but only almost. Direct links to the followed guide can be useful.

  3. On debian based Linux, the following commands can give us some idea and recognize incorrectly installed Docker:

    docker info
    docker version
    

    Review the output before sharing and remove confidential data if any appears (public IP for example)

    dpkg -l 'docker*' | grep '^ii'
    snap list docker
    

    When you share the outputs, always format your posts according to the following guide: How to format your forum posts


I think I was, but I didn’t understand your post then either and wanted to understand it later. You can always post a new message as a reminder and asking if we had time to read the message, even without deleting your previous message.