Implement caching for docker builder
Add compatibility with contrib builder