Recently, I found that the hard disk space of the server was full, so I checked and found that the log files of the docker container took up too much, so I had to clean it up.
The first is to find the storage location of the docker container log file.
1. First, execute the df -Th command and find that the root directory is full.
2. Then go to the root directory and execute du -sh * to find the most occupied files.
3. It is found that the most space is occupied under the /var path.
4. Go to the /var path, search in turn, and find the /var/lib/docker/containers path. The folder name under this path is named after the container id.
5. Enter a certain container path, the file "container id-json.log" is the log file of this container.
6. Execute echo "">container id-json.log to clear the file.