Loading

How to clean up residual docker images in RTF OR in PCE

Data pubblicazione: Nov 27, 2024
Operazione

GOAL

You are using Runtime Fabric / PCE  and need to clean up the residual docker images.

Fasi

1. Enter into gravity if you are using RTF appliances / PCE .

gravity enter

2. Fetch the list of all the images on a given node

docker images --format {{.Repository}}:{{.Tag}}

3. ​Fetch the list of all images belonging to the running containers

docker ps --format {{.Image}}
 

4. Fetch the list of all Unused images

runningImages=$(docker ps --format {{.Image}})
docker images --format {{.Repository}}:{{.Tag}} | grep -v "$runningImages"

5. Cleanup the unused images i.e.To prune including volumes

docker system prune -a --volumes
The above command will remove
- all stopped containers
- all networks not used by at least one container
- all volumes not used by at least one container
- all images without at least one container associated to them
- all build cache

Note

1) The above steps need to be executed in all the cluster nodes.

2) You should also run the following to clean residual Gravity data from previous versions: How to Delete Old Gravity Version Directories in RTF 

Numero articolo Knowledge

001115278

 
Caricamento
Salesforce Help | Article