Dockerfile: optimize caching