Skip to content

wrong calc #22202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
marcus1877 opened this issue Mar 8, 2025 · 1 comment
Open
1 task done

wrong calc #22202

marcus1877 opened this issue Mar 8, 2025 · 1 comment
Labels
area/build Relates to Dockerfiles or docker build command status/triage Needs triage

Comments

@marcus1877
Copy link

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

"A GC sweep would delete 5GB of stale cache as part of the 1st policy, with a remainder of 6GB" is wrong, should be"A GC sweep would delete 2GB of stale cache as part of the 1st policy, with a remainder of 9GB"

Location

https://docs.docker.com/build/cache/garbage-collection/

Suggestion

It should be should be "A GC sweep would delete 2GB of stale cache as part of the 1st policy, with a remainder of 9GB"

@marcus1877 marcus1877 added the status/triage Needs triage label Mar 8, 2025
@thaJeztah thaJeztah added the area/build Relates to Dockerfiles or docker build command label Mar 8, 2025
@crazy-max
Copy link
Member

A GC sweep would delete 5GB of stale cache as part of the 1st policy, with a remainder of 6GB, meaning the 2nd policy does not need to clear any more cache.

I think current docs is correct:

For example, say you have the following GC policies:

  1. Find "stale" cache records that haven't been used in the past 48 hours, and delete records until there's maximum 5GB of "stale" cache left.
  2. If the build cache size exceeds 10GB, delete records until the total cache size is no more than 10GB.

Find "stale" cache records that haven't been used in the past 48 hours, and delete records until there's maximum 5GB of "stale" cache left.
...
...if you have 11GB worth of build cache, where:

  • 7GB of which is "stale" cache
  • 4GB is other, more valuable cache

So on first policy 7GB > 5GB so only 5GB is pruned: 11GB - 5GB = 6GB. Then 5GB are left in the cache so second rule doesn't apply (< 10GB).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Relates to Dockerfiles or docker build command status/triage Needs triage
Projects
None yet
Development

No branches or pull requests

3 participants