1. 先进入docker的映射目录下
cd /home/data/docker/containers/
2. 查看目录的大小
du -sh *
输出结果:
40K 0293fed445e7da2ff43511
192G 0d647d2f25560478397b20d18
179G 15c759f39ad475fa0518ac86
3. cd 到占用内存大的目录下
cd 0d647d2f25560478397b20d18
4. 查看文件大小
du -sh *# 输出
192G 0d647d2f25560478397b20d18-json.log
0 checkpoints
8.0K config.v2.json
0 hash256035564
4.0K hostconfig.json
4.0K hostname
4.0K hosts
0 mounts
4.0K resolv.conf
4.0K resolv.conf.hash
5. 将大的文件重新写入覆盖
echo "123" > 0d647d2f25560478397b20d18-json.log
再执行df查看下结果,内存得到了释放。