Check Available Space on Remote Docker and Docker Layer Caching

Bash Commands

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 to display the amount of disk space used by the Docker daemon:

docker system df

This would produce more human-readable output.

 

Additional Resources

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

Comments

0 comments

Article is closed for comments.