When I rebuild image, docker
uses cache for some layers, but doesn't for others:
Step 1/10 : FROM ubuntu:16.04
---> 6a2f32de169d
Step 2/10 : MAINTAINER User R "mail@gmail.com"
---> Using cache
---> c80135951886
Step 3/10 : RUN apt-get update && apt-get install -y python3 python3-pip
---> Using cache
---> e2fb88917cc1
Step 4/10 : ADD . /srv/dataset-service
---> 9504708a88ae
Removing intermediate container 76532d1a35a9
Step 5/10 : WORKDIR /srv/dataset-service
---> 4e94e0b03138
Removing intermediate container 71b7acc78bd5
Step 6/10 : RUN pip3 install -r requirements.txt && pip3 install grpcio-tools && pip3 install .
---> Running in 7356d49ae7a5
Collecting psycopg2==2.7.1 (from -r requirements.txt (line 1))
...............................................................
...............................................................
Layers from 1 to 5 were build from cache, but from sixth layer was started from scratch. Why docker doesn't use cache for sixth layer?