Right usage of caching in drone with ECR

I’m building a docker image and pushing it to ECR. My docker contains some bigger python packages like pandas etc. which takes some time around 40 to 50 mins. I’m using cache_from step in my docker_build step, it’s working fine for some but it’s not working for --extra-index-url command steps. Not sure what causing the issue.

  - name: docker_build
    image: plugins/ecr
      assume_role: arn:aws:iam::99999999xxxx:role/drone-role
      create_repository: true
      region: eu-west-1
      repo: ${DRONE_REPO_NAME}
        - 99999999xxxx.dkr.ecr.eu-west-1.amazonaws.com/${DRONE_REPO_NAME}:latest
        - ${DRONE_COMMIT_SHA}
        - latest
      use_cache: true
      - test
        - push

Docker command for which cache is not working

RUN pip3 install -r /usr/local/lemonway_etl/requirements.txt \
        --extra-index-url <https link>

I recommend posting this question to the Docker community forum [1] or to stack overflow. This question is very specific to Docker and will likely require help from a Docker expert (such as a Docker employee, Docker maintainer, etc) and I’m not sure you will find that level of Docker expertise in the Drone forum.

[1] https://forums.docker.com/