How to turn off docker caching?

Posted March 3, 2021 1.8k views
DockerDigitalOcean App Platform

How to turn off docker caching in App Platform?
I have a problem with deploying static site, and it feel like it’s not using my updated Dockerfile.

1 comment
  • I’m having the same issue. If I added a new dependency to my project .net 5.0 project (using nuget), it doesn’t pick it up. I don’t get any errors in the console, and the only way I could fix it was by deleting my app and recreating it. I’ll try renaming the component next time.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

👋🏼 @MihkelL

Unfortunately it isn’t possible to disable caching. We are considering adding some form of control over that, but it’s not available yet.

You can manually invalidate the cache by renaming the component, but I’d also like to understand why it is not using the updated Dockerfile. Would you mind opening a support ticket so that can we look into this more closely? Any more details about what’s missing from the build would be appreciated.

  • I’m having this issue as well. Seems really tedious to have to rename the component each time new changes are deployed. I also ended up wasting a lot of build minutes wondering why the new changes haven’t reflected.

    • @boredchinese we are working on a feature that will allow you to purge the build cache. It will be a one-off operation though.

      I’d like to better understand why you need to clear your build cache every time. The cache should behave like normal Docker layer caching, and be invalidated when necessary. Can you give me more details about where in your Dockerfile the cache is used when it shouldn’t be?

You can push your docker image as a new tag and then update the app-spec.yaml via doctl making sure to change the tag in the spec with the new tag of your docker image.