Build context for a Dev Container Feature is invalidated on every build
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 64/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
- 領域
- build-system, cli
調査の方向性
feature-starter の再現、その devcontainer.json、および devcontainer build --docker-path=/usr/bin/podman エントリポイントから始めます。繰り返しビルドを比較し、/tmp/devcontainercli-foo/container-features 配下の feature tarball ディレクトリを調査します。変更のないビルドで feature のインストールレイヤーが再利用され、関連する入力の変更では引き続きそのレイヤーが無効化されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Current behavior
The build context for a Dev Container Feature is invalidated on every build, even when there are no changes to the Containerfile, devcontainer.json, or any files included in the build context.
As a result, the feature installation layer is rebuilt every time instead of reusing the existing cache.
Expected behavior
The Dev Container Feature layer should reuse the build cache whenever possible and only be rebuilt when relevant inputs have changed.
Environment
| Component | Version |
|---|---|
| OS | Ubuntu 24.04 (Kernel 6.8.0-134-generic) |
| Arch | x86_64 |
| Container runtime | Podman 4.9.3 |
| VS Code | 1.112.0 |
| Dev Container CLI | 0.87.0 |
Steps to reproduce
cd /tmp
git clone https://github.com/devcontainers/feature-starter.git
cd feature-starter
Remove the docker-in-docker feature and add the following feature to devcontainer.json:
"ghcr.io/devcontainers/feature-starter/color:1": {
"favorite": "green"
}
Build the dev container:
devcontainer build --docker-path=/usr/bin/podman
Build it again without making any changes:
devcontainer build --docker-path=/usr/bin/podman
Notice that the layer responsible for installing the feature is rebuilt instead of being restored from cache:
[2/2] STEP 5/9: RUN echo "_CONTAINER_USER_HOME=$( (command -v getent >/dev/null 2>&1 && getent passwd 'root' || grep -E '^root|^[^:]*:[^:]*:root:' /etc/passwd || true) | cut -d: -f6)" >> /tmp/dev-container-features/devcontainer-features.builtin.env && echo "_REMOTE_USER_HOME=$( (command -v getent >/dev/null 2>&1 && getent passwd 'node' || grep -E '^node|^[^:]*:[^:]*:node:' /etc/passwd || true) | cut -d: -f6)" >> /tmp/dev-container-features/devcontainer-features.builtin.env
--> Using cache c466b018334665827c5d83c2c00f910ce7f80e4bff6b0eb508ac254590faffba
--> c466b0183346
[2/2] STEP 6/9: RUN --mount=type=bind,from=dev_containers_feature_content_source,source=color_0,target=/tmp/build-features-src/color_0 \
cp -ar /tmp/build-features-src/color_0 /tmp/dev-container-features \
&& chmod -R 0755 /tmp/dev-container-features/color_0 \
&& cd /tmp/dev-container-features/color_0 \
&& chmod +x ./devcontainer-features-install.sh \
&& ./devcontainer-features-install.sh \
&& rm -rf /tmp/dev-container-features/color_0
===========================================================================
Feature : My Favorite Color
Description : A feature to remind you of your favorite color
Id : ghcr.io/devcontainers/feature-starter/color
Version : 1.0.3
Options :
FAVORITE="green"
===========================================================================
Activating feature 'color'
The provided favorite color is: green
...
...
Additional observations
I am not sure exactly how feature tarballs are fetched and unpacked internally, but it appears that the feature tarball is downloaded on every invocation and extracted into a versioned directory under /tmp whose name changes each run.
For example:
$ ls -lh /tmp/devcontainercli-foo/container-features
total 52K
drwxrwxr-x 4 mv mv 4.0K Jul 6 19:15 0.87.0-1783358140200
drwxrwxr-x 4 mv mv 4.0K Jul 6 19:16 0.87.0-1783358186697
drwxrwxr-x 4 mv mv 4.0K Jul 6 19:17 0.87.0-1783358228464
This changing directory name is most likely to be contributing to cache invalidation.
- 主要言語
- TypeScript
- スター
- 3k
- フォーク
- 463
- 平均マージ
- 13時間 28分
- マージ済み PR(30日)
- 2
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
devcontainers/cli のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
devcontainers/cli#1203 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
devcontainers/cli#1178 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
devcontainers/cli#1317 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
devcontainers/cli#1308 ·
メンテナーはふだん 1 日以内に返信
-
build rejects valid tag@digest image references during registry inspection対応中かも @v-Kaniska244 が 9 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
devcontainers/cli#1307 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
devcontainers/cli の issue をすべて見る
似ている issue
-
check:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
[Bug] The shared instance selector's placeholder and no-match text ignore the display language対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
apache/rocketmq-dashboard#5561 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
CopilotKit/OpenDots#69 ·
メンテナーはふだん 1 日以内に返信
-
sendDefaultPii is reported as deprecated on ReactNativeOptions although dataCollection is hiddenオープンBug React-Native Waiting for: Product Owner
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
getsentry/sentry-react-native#6830 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
OSCI'26
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
GauravKarakoti/SecureFlow#1215 ·
メンテナーはふだん 1 日以内に返信