What does the parameter labels
and env
in docker daemon.json
do?
{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3",
"labels": "test",
"env": "os,customer"
}
}
After reading the docker documentation, there is no description for it. And I set it up, I didn’t find anything that worked.
Is it just a marker for docker daemon?
Reference document:dockerd、Docker object labels
Roy176 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Just an arbitrary label you can set, a log driver might use to configure its behavior.
In this case:
If the logging driver supports it, this adds additional fields to the logging output. The following output is generated by the json-file logging driver:
https://docs.docker.com/config/containers/logging/configure/#configure-the-logging-driver-for-a-container