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

DOCTYPE type detailed introduction

<br />We usually declare DOCTYPE in HTML in ...

Two ways to create SSH server aliases in Linux

Preface If you frequently access many different r...

Scoring rules of YSlow, a webpage scoring plugin developed by Yahoo

YSlow is a page scoring plug-in developed by Yaho...

MySQL Installer 8.0.21 installation tutorial with pictures and text

1. Reason I just needed to reinstall MySQL on a n...

Complete steps to achieve high availability with nginx combined with keepalived

Preface In order to meet the high availability of...

Implementation and usage scenarios of JS anti-shake throttling function

Table of contents 1. What is Function Anti-shake?...

Vue implements dynamic routing details

Table of contents 1. Front-end control 1. In the ...

Summary of MySQL development standards and usage skills

1. Naming conventions 1. Database names, table na...

How to Fix File System Errors in Linux Using ‘fsck’

Preface The file system is responsible for organi...

CSS3 sample code to achieve element arc motion

How to use CSS to control the arc movement of ele...

Solution to MySQL IFNULL judgment problem

Problem: The null type data returned by mybatis d...

How to check where the metadata lock is blocked in MySQL

How to check where the metadata lock is blocked i...

Detailed analysis of binlog_format mode and configuration in MySQL

There are three main ways of MySQL replication: S...