Create an official `chisel` container image to improve UX for creating/extending Chiseled base container images

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

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

評価

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

調査の方向性

まず、Issue で求められている Dockerfile の例を確認し、リポジトリの現在のリリースおよびイメージ構築の構成と比較します。バージョン付きの公式 chisel イメージをどのように生成して公開するかを定義し、その後、文書化された chisel cut コマンドを使って rootfs の作成と既存イメージの拡張の両方をサポートしていることを確認します。

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

説明

Thanks to the addition of the chisel manifest, we can now use chisel to perform multiple subsequent installations of slices on the same rootfs. This is great for creating and extending Chiseled base container images.

However, when creating or extending a Chiseled container image, the UX is not that great since you need to acquire chisel before you can create a new rootfs.

Ideally, users wouldn't have to know about chisel's dependencies or need to worry about golang versions, etc.
Providing an official Chisel container image would simplify all of this.

Current UX for acquiring Chisel

Binary
Extending a container image
FROM amd64/ubuntu:noble AS chisel
ARG BASE_IMAGE="ubuntu/dotnet-runtime"
ARG CHISEL_VERSION="v1.X.X"

# Install chisel's dependencies
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        file \
    && rm -rf /var/lib/apt/lists/*

# Install chisel
RUN chisel_url=https://github.com/canonical/chisel/releases/download/v${CHISEL_VERSION}/chisel_v${CHISEL_VERSION}_linux_amd64.tar.gz \
    && curl -fSLOJ ${chisel_url} \
    && curl -fSL ${chisel_url}.sha384 | sha384sum -c - \
    && tar -xzf chisel_v${CHISEL_VERSION}_linux_amd64.tar.gz -C /usr/bin/ chisel

# Install new slices
COPY --from=$BASE_IMAGE / /rootfs/
RUN chisel cut --release ubuntu-24.04 --root /rootfs/ \
            libicu74_libs \
            tzdata-legacy_zoneinfo \
            tzdata_zoneinfo


FROM scratch AS final
COPY --link --from=chisel /rootfs /
Golang
Extending a container image
FROM amd64/golang:1.2X AS chisel
ARG BASE_IMAGE="ubuntu/dotnet-runtime"
ARG CHISEL_VERSION="v1.X.X"

# Install chisel's dependencies
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        file \
    && rm -rf /var/lib/apt/lists/*

# Install chisel tool
RUN go install github.com/canonical/chisel/cmd/chisel@v${CHISEL_VERSION}

# Install new slices
COPY --from=$BASE_IMAGE / /rootfs/
RUN chisel cut --release ubuntu-24.04 --root /rootfs/ \
            libicu74_libs \
            tzdata-legacy_zoneinfo \
            tzdata_zoneinfo


FROM scratch AS final
COPY --link --from=chisel /rootfs /

Desired UX

Creating a base image
FROM amd64/ubuntu/chisel:v1.X.X AS chisel

# Install slices
RUN mkdir -p /rootfs \
    && chisel cut --release ubuntu-24.04 --root /rootfs \
        base-files_base \
        base-files_chisel \
        base-files_release-info \
        ...


FROM scratch AS final
COPY --link --from=chisel /rootfs /
Extending a base image
FROM amd64/ubuntu/chisel:v1.X.X AS chisel
ARG BASE_IMAGE="ubuntu/dotnet-runtime"

# Install new slices
COPY --from=$BASE_IMAGE / /rootfs/
RUN chisel cut --release ubuntu-24.04 --root /rootfs/ \
            libicu74_libs \
            tzdata-legacy_zoneinfo \
            tzdata_zoneinfo


FROM scratch AS final
COPY --link --from=chisel /rootfs /
主要言語
Go
スター
434
フォーク
74
平均マージ
1日 30分
マージ済み PR(30日)
1

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

canonical/chisel のほかの issue

canonical/chisel の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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