Thanks, good to know! I had no idea about the tags. Looks like there’s a lot more variables available.
I just reread the docs on the log drivers - they mentioned that as of docker 20.x local logs now work with all drivers as it buffers the logs locally as well. I think this is probably why I hadn’t explored the other drivers before - couldn’t use docker-compose logs.
If the value is still passed as an environment variable in the end, it can be read via
/proc/:pid/environ
from another container or from the host if they are both using the same UID (or has--cap-add SYS_PTRACE
)