How to delete cache?

I pull git repository in my production-ready image.

RUN git clone --depth=1 --branch=${BRANCH} ${REPOSITORY} .

Before this step I have really heavy steps (1 hour of OpenCV coompilation)
But if I push some changes to git then I need to add some invalidation step. It’s really messy.

I found good solution to use the LABEL. I put a git ref value in the label. It’s even bring real benefits also.
But(!) I specified the label wrongly at latest build

LABEL HASH_COMMIT=${HASH_COMMIT}
# instead of 
LABEL "HASH_COMMIT"=${HASH_COMMIT}

Docket didn’t set the HASH_COMMIT to labels. (I check via docker inspect)
But Docker anyway use cache if I fix it!

I don’t want to do docker system prune -a
It will remove different heavy images too!

I have a lot of pain with it :frowning_face: