Check Available Space on Remote Docker and Docker Layer Caching

You can run the following command to see how much space has been currently used on the Docker Layer Caching volume with Remote Docker.

ssh remote-docker 'sudo df' | grep '/var/lib/docker' | awk '{print $4}'

You could store that value and use it in additional scripting to perform actions to that Remote Docker instance and volume.

DLC_AVAILABLE_SPACE=$(ssh remote-docker 'sudo df' | grep '/var/lib/docker' | awk '{print $4}');

You could also run:

docker system df

This would produce more human-readable output.

Was this article helpful?
0 out of 0 found this helpful



Article is closed for comments.