Rejiggers dockerfile to improve caching