Skip to content

Instantly share code, notes, and snippets.

View DrMavenRebe's full-sized avatar

David Bremner DrMavenRebe

View GitHub Profile
@DrMavenRebe
DrMavenRebe / clean_docker_images.py
Last active January 26, 2016 22:34
Remove unlinked space from the docker drive
#!/usr/bin/env python
"""
Check all existing Docker containers for their mapped paths, and then purge any
zombie directories in docker's volumes directory which don't correspond to an
existing container.
Taken from: https://github.com/docker/docker/issues/6354
"""
import logging
import os
#!/bin/bash
JQPATH=$(which jq)
if [ "x$JQPATH" == "x" ]; then
echo "Couldn't find jq executable." 1>&2
exit 2
fi
set -eu
shopt -s nullglob