Check Available Disk Space with Remote Docker and Docker Layer Caching

When running Remote Docker with Docker Layer Caching you can run the following commands to see how much space has been currently used on the volume before running your build.

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

You could store that value and use it to see how much remaining space you have. Our DLC volumes are 50GB.

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


You could also simply run the following command to output the available space into your build logs

docker system df
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.