Docker /var/lib/docker/aufs/mnt directory cleaning method

Docker /var/lib/docker/aufs/mnt directory cleaning method

The company's service uses docker, and the disk man is found. Then execute the following command to get it done

1. Create a script file

vi cleandocker.sh

The content is as follows:

#!/bin/sh
echo "====================== start clean docker containers logs ==========================="
logs=$(find /var/lib/docker/containers/ -name *-json.log)
for log in $logs
    do
   echo "clean logs : $log"
        cat /dev/null > $log
    done
echo "====================== end clean docker containers logs ==========================="

2. Authorize the script file

chmod 755 cleandocker.sh

3. Execute the script

./cleandocker.sh

This is the end of this article about how to clean up the docker /var/lib/docker/aufs/mnt directory. For more information about docker directory management, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Introduction to the differences between Docker aufs storage driver layer, diff, and mnt directories
  • Docker file system-AUFS principle introduction

<<:  MySQL 8.0.18 installation and configuration graphic tutorial

>>:  WeChat applet realizes the function of uploading pictures

Recommend

Use of vuex namespace

Table of contents Since Vuex uses a single state ...

A preliminary understanding of CSS custom properties

Today, CSS preprocessors are the standard for web...

MySQL Packet for query is too large problem and solution

Problem description: Error message: Caused by: co...

A brief discussion on the correct posture of Tomcat memory configuration

1. Background Although I have read many blogs or ...

Vue component communication method case summary

Table of contents 1. Parent component passes valu...

The use of anchor points in HTML_PowerNode Java Academy

Now let's summarize several situations of con...

mysql5.7 installation and configuration tutorial under Centos7.3

This article shares the MySQL 5.7 installation an...

A bug fix for Tomcat's automatic shutdown

Preface Recently, a Java EE web project that has ...

Detailed tutorial on installing Tomcat8.5 in Centos8.2 cloud server environment

Before installing Tomcat, install the JDK environ...

How to prevent hyperlink redirection using JavaScript (multiple ways of writing)

Through JavaScript, we can prevent hyperlinks fro...

How to use pdf.js to preview pdf files in Vue

When we preview PDF on the page, some files canno...

Centos7 mysql database installation and configuration tutorial

1. System environment The system version after yu...

How to configure multiple projects with the same domain name in Nginx

There are two ways to configure multiple projects...

How to specify parameter variables externally in docker

This article mainly introduces how to specify par...

Several ways to schedule backup of MySQL database (comprehensive)

Table of contents 1. mysqldump command to back up...