How to delete logs of docker container

Introduction

The docker container will generate logs and store them locally. You can find the specified container and delete the corresponding log file.

This tutorial will teach you how to delete log files generated by docker containers

Enter the docker container path

/var/lib/docker/containers/

Enter the corresponding container directory

docker ps -a

Enter the corresponding container directory

After entering or pasting the id, you can use tab to complete the directory

cd b8af02560de92655228155f96fa773038b298288061c1ba8dfa8b00f23bdc8e1

delete log file

rm *.log

Notice

If you have any questions in use, you can leave a message below, or submit issuse on github ♥