mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
127 stars 41 forks source link

[Bug]: Docker volume clean does not work (very well) #15119

Open KevinMind opened 2 weeks ago

KevinMind commented 2 weeks ago

What happened?

When running make up/down docker compose the existing command docker volume prune --force does not remove a large set of anonymous volumes.

I've narrowed down the actual STR.

  1. run make up on local image make up DOCKER_VERSION=local
  2. Expect around 5-6 anonymous volumes (new ones)
  3. change the version to something else make up DOCKER_VERSION=latest
  4. Expect compose to replace existing volumes with new ones, net neutral number of volumes.
  5. Actual: it creates the volumes but unlinks the old ones without destroying them..

It seems like this is happening because docker compose is not properly labeling the anonymous volumes so when we re-run make up and it "re-creates" the containers using those volumes it just creates new ones, thinking they don't already exist.

This is a semi-documented issue in docker but might be an edge case.

What did you expect to happen?

It should remove all anonymous/orphaned volumes to prevent accumulation of volumes over time.

Is there an existing issue for this?

┆Issue is synchronized with this Jira Task

KevinMind commented 2 weeks ago

This issue should theoretically be fixed by https://github.com/moby/moby/issues/48748

However the question will still remain if the label associated anon volumes with our project will still cause some volumes to be skipped.