It can be difficult to invalidate the cache on some stages of a Dockerfile. The solution advocated by Github, at having to use an environment variable or an argument based on timestamp, is hard to put in place with C cker-composed.
So I cale up with this workaround (a little dirty, it must be admitted), to be able to invalidate the cache (and thus replay all are the steps that will be below these lines):
ADD https://www.random.org/strings/?num=1&len=15&digits=on&upperalpha=on&loweralpha=on&unique=on&format=plain&rnd=new cache_busting.html RUN rm cache_busting.html
This workaround is still running on the latest version of Docker, at the time of writing (17.12.1-ce (2018-02- 27))