Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lbussell opened this issue Jan 29, 2025 · 2 comments

Comments

@lbussell
Copy link
Contributor

lbussell commented Jan 29, 2025

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

@lbussell
Copy link
Contributor Author

lbussell commented Feb 3, 2025

[Triage] Another solution would be for Canonical to offer a Chisel container image. This would simplify the workflow for adding additional slices while keeping our SDK images as small as possible.

@lbussell
Copy link
Contributor Author

@lbussell lbussell closed this as not planned Won't fix, can't repro, duplicate, stale Feb 10, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in .NET Docker Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant