# How to delete cache?

**URL:** <https://forums.docker.com/t/how-to-delete-cache/5753>\
**Category:** General\
**Created:** [January 20, 2016, 11:19pm UTC](https://forums.docker.com/t/how-to-delete-cache/5753 "2016-01-20T23:19:04Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![im7mortal](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/im7mortal/32/20177_2.png) [@im7mortal](https://forums.docker.com/u/im7mortal)\
**Post date:** [June 20, 2018, 9:43pm UTC](https://forums.docker.com/t/how-to-delete-cache/5753/5 "2018-06-20T21:43:58Z")

</div>

I pull git repository in my _production-ready_ image.

```auto
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

```auto
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 ☹

---

_[View the full topic](https://forums.docker.com/t/how-to-delete-cache/5753)._
