My YunoHost server
Hardware: Hetzner VPS, 40 GB
YunoHost version: 11.0.10.2
I have access to my server : Through SSH
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
Relevant apps: GitLab
Disclaimer: I already solved this support request, and Iβm posting it here for legacy and potentially any comments about how my solution has doomed my installation.
Description of my issue
While exploring my YunoHost server in an attempt to increase available storage, I discovered that /var/lib/docker/
occupies ~6GiB.
Given that docker was not installed on my system, it took me some time to determine that these directories were being created by GitLabβs CI pipelines.
Hereβs the output of tree /var/lib/docker
(negligible file/dir sizes are not indicated):
[ 5.7GiB] /var/lib/docker
βββ [ 3.7 GiB] overlay2
β βββ [ 520 MiB ] 103222...
β βββ [ 520 MiB ] 194cda...
β βββ 20 more containers of various sizes
βββ [ 1.9 GiB ] volumes
βββ [ 920 MiB ] runner-d8ed6mmy-project-2-concurrent-0-cache-...
βββ [ 500 MiB ] runner-d8ed6mmy-project-4-concurrent-0-cache-...
βββ a few other volumes of various sizes
βββ backingFsBlockDev
βββ metadata.db
βββ buildkit
βββ containers
βββ image
βββ network
βββ plugins
βββ runtimes
βββ swarm
βββ tmp
βββ trust
Solution
After researching this, I did the following:
- Install docker to be able to interact with it (as it is not exposed by GitLab)
- Have a look at how docker is being used on your system, to get an idea of what you can clean/should not touch
-
sudo docker ps -a
for running containers -
sudo docker images
for existing images -
sudo docker volume ls
for existing volumes -
sudo docker images -f "dangling=true"
for images without containers -
sudo docker system df
for docker disk usage
-
- Clean images and containers (based on discussions here and here)
-
sudo docker image prune --all
for removing unused images -
sudo docker system prune --all
for removing unused data - in theory, we could also do
sudo docker volume prune --all
for removing unused volumes, but the disk usage by volumes was too low to justify finding out if it breaks anything.
-
Does anyone have comments on whether this is correct/doesnβt go far enough/is awful? Thanks!
NB: In case youβre reading this because youβre trying to reduce your disk usage, have a look at removing unused node versions and cleaning your logs.