Cleaning container following docker log

1. docker info find docker root dir

 

 

2. go to /var/lib/docker

 

 3. constainers below each container file folder, -json.log end of the file is stored LOG.

 

 

4. The cleaning can be empty, an instruction can be any of the following:

  1.truncate  -s  0  8cb8607c02341373814ad4cd1b3d9723dc9356c4d69fc5b2160a6d71795c8872-json.log

  2.cat /dev/null > 8cb8607c02341373814ad4cd1b3d9723dc9356c4d69fc5b2160a6d71795c8872-json.log

  3. > 8cb8607c02341373814ad4cd1b3d9723dc9356c4d69fc5b2160a6d71795c8872-json.log

  4.echo " " > 8cb8607c02341373814ad4cd1b3d9723dc9356c4d69fc5b2160a6d71795c8872-json.log

 

The following instruction is to empty the batch

View all containers and clean up all log size container logs command:

ls -lh $(find /var/lib/docker/containers/ -name *-json.log)

truncate -s 0 /var/lib/docker/containers/*/*-json.log

Guess you like

Origin www.cnblogs.com/sucretan2010/p/11882737.html
Recommended