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

Abierto
#203 6 comentarios 7 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
docker, go

Línea de trabajo

Comienza revisando los ejemplos de Dockerfile deseados en el issue y compáralos con la configuración actual de release y creación de imágenes del repositorio. Define cómo debe producirse y publicarse una imagen oficial de chisel versionada y, después, verifica que admita tanto la creación de un rootfs como la ampliación de una imagen existente con los comandos documentados de chisel cut.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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 /
Lenguaje dominante
Go
Estrellas
434
Forks
74
Merge medio
1 d 30 min
PR fusionados (30 d)
1

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de canonical/chisel

Todos los issues de canonical/chisel

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.