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

New feature: Add --build-secret argument

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

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
docker, shell, typescript

調査の方向性

issue に示されている devcontainer build コマンドから始め、feature のビルドがどのように Dockerfile を合成するかを追跡します。--build-secret とローカル feature の install.sh を使って例を再現します。feature が /run/secrets/compose_file を読み取ることができ、結果のイメージに期待される secret の内容が含まれていれば完了です。

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

説明

feature-request

In our CI pipeline, we use build secrets to inject secrets for our internal registries into our Dockerfile. However, the devcontainer CLI currently doesn't support using those secrets from within a feature. This limitation exists because the synthesized Dockerfile for building features requires additional parameters like --mount=type=secret,id=aws.

I created a PR that addresses this issue and allows providing secrets to features in the same way as with a regular docker buildx command. Here's an example of how it works:

In the feature install.sh:

#!/bin/bash
set -e
if [ -f /run/secrets/compose_file ]; then
    echo "Contents of secret file:"
    cat /run/secrets/compose_file
    echo "Writing secret file contents to /secret_file.txt"
    cat /run/secrets/compose_file > /secret_file.txt
else
    echo "Secret file not found!"
    exit 1
fi

On the terminal:

devcontainer build --workspace-folder test-build-secrets --build-secret id=compose_file,src=./my_cred.txt --image-name test-build-secrets-image --no-cache
docker run --rm --entrypoint="cat" test-build-secrets-image /secret_file.txt

This will build the devcontainer with the local feature and print out the secret content.

Note: Writing the secret to a file is obviously the opposite of what one would actually do with the build-secret flag, but it demonstrates that the secret can be read and used just like with regular Docker secrets.

主要言語
TypeScript
スター
3k
フォーク
461
平均マージ
18分
マージ済み PR(30日)
5

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

devcontainers/cli のほかの issue

devcontainers/cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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