(Optional) Configuring Container Image Logs
On the Atlas 200 AI accelerator module (RC) and Atlas 500 Pro AI edge server (model 3000), if logs in a container are printed in the standard output, container logs may fail to be wrapped, causing drive space exhaustion. You are advised to perform the following configurations.
Procedure
- Log in to the operating environment as the root user.
- Run the following command to open the daemon.json file:
vi /etc/docker/daemon.json
- If the daemon.json file is empty, add the following content to the file:
{ "log-driver": "json-file", "log-opts": { "max-size": "2m", "max-file": "2" } } - If the daemon.json file contains some content, add the preceding content to the end of the existing content. The format is as follows:
{ "XXXXXXX":"xxxxxxxx" # Existing content "XXXXXXX":"xxxxxxxx" # Existing content , "log-driver": "json-file" "log-opts": { "max-size": "2m", "max-file": "2" } }
Parameter Description (The following parameter values are for reference only. Set their values as required.)- max-size: maximum size of a log file before it is dumped. If the size of a log file reaches 2 MB, only a new file will be generated for storing logs.
- max-file: maximum number of log files that can be dumped. (Only the latest two files are present.)
Save the change and exit.
- If the daemon.json file is empty, add the following content to the file:
- Run the following commands to restart Docker:
systemctl daemon-reload systemctl restart docker
- The configuration takes effect only for the containers created after the configuration is modified.
- If Docker fails to be restarted after the configuration file is modified, check whether other configurations are specified in the Docker service file.
Parent topic: Setting Up the Environment