In docker-compose, the startup parameters of Container A depend on the running result of Container B. what should I do?

I really don"t know how to describe it

Let"s put it this way, my docker-compose contains two services: container An and container B;
the persistence directory of container A when it starts is the log directory of container B, but the directory is random, that is, container B can only get it through the docker inspect command after startup; it is possible to start container A separately and use the shell script, but I want to start it together in a docker-compose.yml file.

Welcome to the solution! Thank you ~

Oct.01,2021
Can't the log directory of

Container B be persisted? Why random?

Menu