Skip to content

Add chisel tool to the Ubuntu .NET 10 SDK image to make adding additional slices easier #6186

@lbussell

Description

Describe the Problem

With #6135, it's now possible to install new packages on top of an existing Ubuntu Chisel installation. Here's an example of what that might look like today:

https://gist.github.com/lbussell/e54483958fe6f1ccb8a44b0a07c296f5#file-1-chisel-install-additional-slices-dockerfile

You'll notice that about a third of the Dockerfile is dedicated to installing a specific version of chisel.

Describe the Solution

We could use the go CLI for installing the tool - e.g. go install github.com/canonical/chisel/cmd/chisel@<tag>. But that would still require installing the go package on top of the .NET SDK image.

If we included the chisel tool in the .NET SDK image, then:

  1. This scenario would get a lot simpler.
  2. We could ensure that users end up using the same version of chisel that we used to build our own runtime-deps image.

The resulting user Dockerfile would then look something like this:

FROM mcr.microsoft.com/dotnet/nightly/sdk:10.0-preview-noble AS build
ARG TARGETARCH

# create new base image with additional packages
COPY --from=mcr.microsoft.com/dotnet/nightly/runtime-deps:10.0-preview-noble-chiseled / /rootfs/

# install additional packages onto the base image rootfs
RUN chisel cut --release ubuntu-24.04 --root /rootfs/ \
        libicu74_libs \
        tzdata-legacy_zoneinfo \
        tzdata_zoneinfo

<All of the .NET app COPY, restore, and publish instructions>


FROM scratch AS final

# copy the base image
COPY --from=chisel /rootfs /
# copy app
COPY --from=build /app /app/
ENTRYPOINT ["/app/App"]

Additional Context

Related: #4811

Metadata

Assignees

No one assigned

    Labels

    Projects

    • Status

      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions