I have docker-compose and Dockerfile:
...
RUN echo date
RUN echo date >> /timestamp.txt
...
and when I delete image and try to create it again I have this message:
#5 [spring-boot-app stage-0 6/9] RUN echo date
#5 CACHED
#6 [spring-boot-app stage-0 7/9] RUN echo date >> /timestamp.txt
#6 CACHED
As I understand docker should not CACHE commands that change result, isn’t it?
I try to make command in Dockerfile with random result and expect that docker will not CACHE it.