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

Consider consolidating Dockerfiles across architectures/variants #5029

Closed
lbussell opened this issue Nov 28, 2023 · 2 comments
Closed

Consider consolidating Dockerfiles across architectures/variants #5029

lbussell opened this issue Nov 28, 2023 · 2 comments

Comments

@lbussell
Copy link
Contributor

Describe the Problem

With .NET 8 (and soon to be .NET 9), we have significantly more images per version of .NET than previous releases. For example, we have 12 versions of .NET 8 runtime-deps in nightly, compared to 8 variants in .NET 6. When Ubuntu 24.04 releases, we'll have 16 versions. There is opportunity to consolidate Dockerfiles that share much of their implementation.

Describe the Solution

I see two major ways that we could reduce the number of Dockerfiles in our repo:

  • Consolidation across variants:
    • With Add Ubuntu Chiseled extra images for Runtime and ASP.NET Core #5028, we will have several sets of Dockerfiles that differ only in their FROM lines, as the aspnet and runtime images just copy .NET binaries on top of their base image.
    • Cons: the Dockerfile is potentially easier to find for a given image, Dockerfile is easier to understand and easier for users to build it themselves.
  • Consolidation across architectures:
    • Since we created our infrastructure, Docker has improved support for multi-platform builds with BuildKit and Buildx. We should experiment with building all architectures of a given image from the same Dockerfile.
    • Pros: Easier to build multi-platform images yourself without creating a manifest
    • Cons: Harder to have specific content for each arch if necessary.

Additional Context

The return on investment for this alone is up for debate - but if we decide something like #4704 is worth pursuing and this can be a part of that change, we should have a clear idea of where we stand on this topic.

@mthalman
Copy link
Member

What are the benefits of doing this? It doesn't change the fact that we still need to maintain all these variants as distinct images. So we need to still account for the variability in some way. Today that's done via manifest.json and the Dockerfile templates. That maintenance burden doesn't really change a whole lot if we were to do this.

@lbussell
Copy link
Contributor Author

[Triage] After discussion in triage, there are some pros and cons to this, but it wouldn't be an insignificant amount of work. There are no plans at the moment to pursue this.

@lbussell lbussell closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2023
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

2 participants