You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your app's Dockerfile doesn't install any additional Linux packages or depend on any shell scripts for setup, Ubuntu Chiseled images could be a drop-in replacement for our full Ubuntu or Debian images.
33
+
If your app's Dockerfile doesn't depend on any shell scripts for setup, Ubuntu Chiseled images could be a drop-in replacement for our full Ubuntu or Debian images.
34
+
35
+
## How do I install additional packages on Chiseled images?
36
+
37
+
> [!IMPORTANT]
38
+
> Installing additional packages requires the presence of the [Chisel manifest](https://github.com/dotnet/dotnet-docker/issues/6135), which is currently only available in **.NET 10+** images.
39
+
40
+
[Chisel](https://github.com/canonical/chisel) is built on the idea of package slices.
41
+
Slices are basically subsets of packages, with their own content and set of dependencies to other internal and external slices.
42
+
Chisel relies on a [database of slices](https://github.com/canonical/chisel-releases) that are indexed per Ubuntu release.
43
+
You can only install packages that are available as slices.
44
+
45
+
First, acquire `chisel` and `chisel-wrapper`.
46
+
`chisel-wrapper` (from [rocks-toolbox](https://github.com/canonical/rocks-toolbox/)) is used to generate a dpkg status file documenting which packages are installed, which is used by many vulnerability scanning tools.
47
+
48
+
```Dockerfile
49
+
FROM mcr.microsoft.com/dotnet/nightly/sdk:10.0-preview-noble AS chisel
Finally, copy the new root filesystem into a scratch base image for your final (runtime) layer.
88
+
89
+
```Dockerfile
90
+
FROM scratch AS final
91
+
COPY --link --from=chisel /rootfs /
92
+
WORKDIR /app
93
+
COPY --link --from=build /app .
94
+
USER $APP_UID
95
+
ENTRYPOINT ["./app"]
96
+
```
97
+
98
+
Copying the entire filesystem into the final `FROM scratch` layer results in a perfectly space- and layer-efficient installation of the additional slices.
99
+
However, it's important to note that this pattern does not allow any layer sharing with your chosen .NET base image - the first `COPY` instruction in the final stage is essentially creating a completely new base image layer.
100
+
Keep this in mind when creating your Dockerfiles - for example, you may find it beneficial to share layers between multiple .NET images running in the same Kubernetes cluster.
0 commit comments