This is taken from https://github.com/efrecon/docker-image-extract