[BUG] down -v removes a named volume owned by another project
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 73/100
Direzione di ricerca
Start at the down -v volume removal path and compare its ownership handling with the warning emitted by up for a volume labeled with another project name. The issue gives a two project reproduction using the same explicit volume name; run those steps and confirm down -v preserves the other project's volume and warns. No source file or test path is named in the issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
When two projects declare a volume with the same explicit name: (without external: true), docker compose down -v in one project removes the volume that the other project created, along with its data.
up already detects this case. It warns volume "..." already exists but was created for project "proja" (expected "projb") and reuses the volume without touching it. down -v makes no such check: it removes the volume by name, with no warning.
A common way to hit this: the same repository checked out in several directories or git worktrees. Each checkout gets its own project name (from its directory), but a volume name: hard-coded in compose.yaml is the same in all of them.
Current behavior: down -v in projb removes proja's volume (Volume n2-shared-data Removed, exit 0).
Expected behavior: down -v only removes volumes this project owns. For a volume labeled for another project, it skips the volume and warns, just as up warns about it.
Steps To Reproduce
- Create two directories,
proja/andprojb/, each with thiscompose.yaml:services: app: image: alpine:3.20 command: sleep infinity volumes: - data:/data volumes: data: name: n2-shared-data - In
proja/:docker compose up -d && docker compose exec app sh -c 'echo important > /data/file' && docker compose down docker volume inspect -f '{{index .Labels "com.docker.compose.project"}}' n2-shared-dataprintsproja.- In
projb/:docker compose up -d, which prints the warning above (created for project "proja" (expected "projb")). - In
projb/:docker compose down -vprintsVolume n2-shared-data Removed. proja's volume and its data are gone.
Compose Version
Docker Compose version 5.0.1
Docker Environment
Server Version: 29.1.3
Operating System: Docker Desktop
OSType: linux
Architecture: aarch64
Kernel Version: 6.12.54-linuxkit
Storage Driver: overlayfs
Anything else?
No response
- Lingua principale
- Go
- Stelle
- 38.4k
- Fork
- 5.9k
- Merge medio
- 1g 17h
- PR unite (30g)
- 69
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di docker/compose
-
kind/bug status/0-triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
[BUG] A start failure in one service aborts the start of unrelated services (unreleased regression)Apertakind/bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 57/100
docker/compose#14372 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Support OSC 7501 progressApertakind/feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
docker/compose#14365 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
kind/feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
docker/compose#14356 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Epic: Move service selection into the backend API instead of pre-filtering the project in the CLIAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di docker/compose
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
kind/engineering pulumi/pulumi-terraform Task Workflow Failure
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
pulumi/pulumi-terraform#1261 ·
I maintainer di solito rispondono entro 1 giorno
-
Controllers integration tests fail when port 8080 is in useForse già presa @noahnut l’ha presa oggi. Apertaarea/cluster-autoscaler kind/bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
kubernetes-sigs/cluster-autoscaler#236 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
MCP: `tasks_bulk_update` always fails with "Need at least one field" — the `fields` projection argument is stripped from non-read tools tooForse già presa @tink-bot l’ha presa oggi. Apertaagent-processed area/api-v2 integration/inbound
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
go-vikunja/vikunja#4235 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
google/osv-scalibr#2503 ·
I maintainer di solito rispondono entro 1 giorno