[+] 增加清理磁盘脚本
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 52s
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 52s
This commit is contained in:
parent
f7edc9d09e
commit
c862c17133
@ -64,3 +64,8 @@ docker compose run ubuntu ./init-all.sh
|
|||||||
```bash
|
```bash
|
||||||
docker compose run ubuntu-2204 ./init-all.sh
|
docker compose run ubuntu-2204 ./init-all.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 清理磁盘
|
||||||
|
```bash
|
||||||
|
curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/clean.sh | bash
|
||||||
|
```
|
17
clean.sh
Normal file
17
clean.sh
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# 清理 apt
|
||||||
|
sudo apt-get autoremove -y
|
||||||
|
sudo apt-get autoclean -y
|
||||||
|
sudo apt-get clean -y
|
||||||
|
# 清理 docker
|
||||||
|
docker system prune -a -f --volumes
|
||||||
|
# 清理日志
|
||||||
|
sudo journalctl --vacuum-size=10M
|
||||||
|
# 列出清理后容器大小
|
||||||
|
docker ps -a --format "{{.ID}}\t{{.Image}}\t{{.Size}}"
|
||||||
|
docker images --format "{{.Repository}}:{{.Tag}}\t{{.Size}}"
|
||||||
|
# 列出磁盘空间
|
||||||
|
df -h
|
||||||
|
|
||||||
|
# 查看占用磁盘
|
||||||
|
# sudo du -ah / | sort -rh | head -20
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user