Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[BUG] down -v removes a named volume owned by another project

オープン
#14,373 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@htoyoda18 がすでに取り組んでいます。

2026年10月21日 から。

  • #14374 @htoyoda18 による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
73/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
docker-compose, go
領域
devops, tooling

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

kind/bug
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
  1. Create two directories, proja/ and projb/, each with this compose.yaml:
    services:
      app:
        image: alpine:3.20
        command: sleep infinity
        volumes:
          - data:/data
    volumes:
      data:
        name: n2-shared-data
    
  2. In proja/: docker compose up -d && docker compose exec app sh -c 'echo important > /data/file' && docker compose down
  3. docker volume inspect -f '{{index .Labels "com.docker.compose.project"}}' n2-shared-data prints proja.
  4. In projb/: docker compose up -d, which prints the warning above (created for project "proja" (expected "projb")).
  5. In projb/: docker compose down -v prints Volume n2-shared-data Removed.
  6. 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

主要言語
Go
スター
38.4k
フォーク
5.9k
平均マージ
1日 17時間
マージ済み PR(30日)
69

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

docker/compose のほかの issue

docker/compose の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。