ASM - OPMS - We see high space usage of /var/lib/dockers/overlay2 directory
search cancel

ASM - OPMS - We see high space usage of /var/lib/dockers/overlay2 directory


Article ID: 200035


Updated On:


CA Application Performance Management SaaS


We have OPMS installed on a Linux server and noticed that we have close to 8 GB space under /var/lib/dockers/overlay2 directory.

As a  /var directory is OS level, we can't increase space in this directory.

Can you tell us if there is a way to manage the space under this directory?



Release : SAAS

Component : ASM -OPMS 


The directories under overlay2 are related to OPMS docker 


The easiest and safest way is this:

1) Make sure all services are running:
monit summary
and everything is green (no stopped service, no errors). If not, do not continue!

2) Run these 2 commands to check how much space is occupied
docker system df
docker df -v

3) Execute
docker system prune
You will be asked if you are sure to remove stopped containers and dangling images. Answer yes.
That's why we need step 1. If some container is stopped it is removed.

4) Run
docker images | awk '/<none>/ {print $3}' | xargs docker rmi
this can report a syntax error in case there are no untagged images, please ignore 

It finds all images that are not tagged. The result is passed using xargs to  thedocker rmi command.
But if the output is empty 'docker rmi' complains about missing arguments. It means there is nothing to cleanup.

5) Repeat step 2

Since OPMS version 10.3 we've moved all docker image downloads from post-inst scripts to startup scripts. Thus, if they have the latest OPMS version (10.4) and did not enforce strict
firewall rules on the outgoing communication it is safe to stop all services, delete all docker images and containers (brute force cleanup) and start it again.
All necessary docker images will be automatically downloaded (it can take some time).