[Bug]: --mount and -v accept a relative container path and mount it at /<path>
メンテナーはふだん 1 日以内に返信
@devops-thiago がすでに取り組んでいます。
2026年10月1日 から。
評価
調査の方向性
Sources/Services/ContainerAPIService/Client/Parser.swift から始め、特に Parser.validateMount と Parser.tmpfsMounts を確認し、それぞれの mount 形式が destination をどのように検証しているかを比較してください。--mount、-v、--tmpfs について、相対、空、ドットベースのコンテナパスが既存の絶対パスエラーで一貫して拒否されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I have done the following
- I have searched the existing issues
- If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
Give any mount form a relative path on the container side:
container run --rm --mount type=bind,source=/tmp,target=data alpine:latest sh -c 'ls -ld /data; mount | grep " /data "'
The container starts and the host folder is mounted at /data (image pull progress omitted):
drwxrwxrwt 1241 root root 39712 Oct 1 17:26 /data
virtiofs on /data type virtiofs (rw,relatime)
The other forms are accepted the same way and also end up at /data:
container volume create evvol
container run --rm --mount type=volume,source=evvol,target=data alpine:latest ... # ext4 on /data
container run --rm -v evvol:data alpine:latest ... # ext4 on /data
container run --rm -v data alpine:latest ... # anonymous volume, ext4 on /data
container run --rm --mount type=tmpfs,target=data alpine:latest ... # tmpfs on /data
Paths with . and .. are accepted too. target=../x is mounted at /x, -v data:a/../../y at /y and target=./z at /z.
--tmpfs rejects the same path:
$ container run --rm --tmpfs data alpine:latest true
Error: data is not an absolute path
container create stores the value as typed. container inspect shows "destination" : "data" for a container whose running mount is /data.
A debug build of main at 0a48a1b accepts the same forms and rejects --tmpfs.
Problem description
Parser.validateMount is where parsed --mount and -v values are checked. For a filesystem or volume mount it only checks that the container path is not empty:
if fs.destination.isEmpty {
throw ContainerizationError(.invalidArgument, message: "mount destination cannot be empty")
}
--tmpfs is stricter. Parser.tmpfsMounts rejects a relative path, added in #2103 for #2094, which says the destination "must be a non-empty absolute path". The same input is therefore an error for one flag and quietly reinterpreted by the others. A typo such as -v data:app/data mounts at /app/data without a word.
The container path is a location inside the container, and the OCI runtime spec requires it to be an absolute path (mounts[].destination in config.md). Every mount form should fail at parse time with the message --tmpfs already gives.
Environment
- OS: macOS 26.6.2 (25G83)
- Xcode: 26.6 (17F113)
- Container: 1.5.0 (Homebrew), and main at 0a48a1b
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要言語
- Swift
- スター
- 51k
- フォーク
- 1.8k
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 35
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apple/container のほかの issue
-
[Bug]: Intermittent failure in PathUtilsTests.testNewDirectoryIsExcludedAndExistingChoiceIsKeptオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
apple/container#2474 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[Request]: container ls --filter label=key=value対応中かも @kavix が 12 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
apple/container#2403 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Request]: Improve robustness and path resolution in ensure-hawkeye.sh対応中かも @denizguney が 36 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: kernel download hangs forever when the server stops sending対応中かも @devops-thiago が 38 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
apple/container#2327 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: container export -o deletes an existing directory対応中かも @devops-thiago が 38 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apple/container#2325 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
apple/container の issue をすべて見る
似ている issue
-
🎉 Add Filetorオープンaddition
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
jaywcjlove/awesome-mac#4409 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
abue-ammar/tinycast#1851 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:ui good first issue priority:p2 type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
area: build-and-ci possible-duplicate S3: minor
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
manaflow-ai/cmux#38889 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
agent-ready area:skills
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
jmbarzee/temporal-architect#616 ·
メンテナーはふだん 1 日以内に返信