TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How .NET container images are maintained

141 pointsby alexis2bover 4 years ago

4 comments

ImJasonHover 4 years ago
container-diff[0], mentioned in the article, is a really useful image release tool, that I don&#x27;t think gets enough love.<p>0: <a href="https:&#x2F;&#x2F;github.com&#x2F;GoogleContainerTools&#x2F;container-diff" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;GoogleContainerTools&#x2F;container-diff</a>
评论 #26120438 未加载
评论 #26118854 未加载
qbasic_foreverover 4 years ago
I am really curious, who is actually using Windows containers in a way that&#x27;s critical to their business? (i.e. your main web app, not giving some janky legacy Windows thing a place to live while you migrate away from it)<p>I have to imagine at some point probably very soon all of the time spent maintaining and hacking in the NT kernel to work in a container world is just throwing good money at a vanishingly small segment of the market.<p>kudos to this team for being on the ball and supporting ARM and ARM64 images though. Now when can we actually run ARM64 stuff on Azure....
评论 #26121691 未加载
评论 #26121614 未加载
评论 #26123695 未加载
评论 #26122595 未加载
评论 #26122718 未加载
评论 #26122253 未加载
raziel2pover 4 years ago
Wanted to know more about the tools they use for maintaining and scanning, but I guess many of them are internal and not open source?
评论 #26120347 未加载
jonjonsonjrover 4 years ago
&gt; Comparing image digests won’t work; they will never match.<p>This is a strong assertion with no further explanation. It reads like a generic truth about container images, but it&#x27;s certainly possible to achieve this, as referenced later:<p>&gt; Sidebar: Various folks in the container ecosystem are looking at enabling deterministic images. We welcome that. See Building deterministic Docker images with Bazel and DETERMINISTIC DOCKER IMAGES WITH GO MICROSERVICES.<p>I&#x27;ll agree that docker makes it _really_ difficult to build and consume reproducible images (for a variety of reasons, see <a href="https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;go-containerregistry&#x2F;issues&#x2F;895#issuecomment-753521526" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;go-containerregistry&#x2F;issues&#x2F;895#is...</a> and <a href="https:&#x2F;&#x2F;twitter.com&#x2F;lorenc_dan&#x2F;status&#x2F;1343921451792003073" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;lorenc_dan&#x2F;status&#x2F;1343921451792003073</a> for a sampling of interesting ones), but there is more to the container ecosystem than docker or Dockerfiles.<p>Shameless plug: I help maintain ko (<a href="https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;ko" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;ko</a>), which can achieve reproducible builds for go projects without much fuss. It also leans heavily on go&#x27;s excellent support for cross-compilation to produce multi-platform images, trivially.<p>&gt; There are two cases where the container-diff tool will report that the registry and local images that you are comparing are the same (in terms of Docker history lines), but will be misleading because the images are actually different.<p>While container-diff is great, it can obscure what&#x27;s really going on a bit. If you&#x27;re interested in uncovering exactly why the digest of the image you built is different from what was published, please forgive another shameless plug for crane (<a href="https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;go-containerregistry&#x2F;blob&#x2F;main&#x2F;cmd&#x2F;crane&#x2F;README.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;go-containerregistry&#x2F;blob&#x2F;main&#x2F;cmd...</a>), a tool I wrote to expose most of the functionality of go-containerregistry (<a href="https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;go-containerregistry" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;google&#x2F;go-containerregistry</a>), which is the library both container-diff and ko use under the hood.<p>Forgive the sparse documentation, but it should be relatively straightforward for anyone familiar with the registry API and data structures, as the commands map pretty directly to registry functionality. Using crane, you can easily inspect the image in the registry directly to compare the manifests and blobs that make up an image.<p>For example, one reason that the digests might never match is that these images are somewhat strangely wrapped as singleton manifest lists: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;jonjohnsonjr&#x2F;ffba104ca504b5bb4a1f22749e624abf" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;jonjohnsonjr&#x2F;ffba104ca504b5bb4a1f227...</a><p>It makes some sense to me that they might want to do this to prevent folks from pulling this on windows, but usually you would only encounter manifest lists for multi-platform images. Even if these builds were reproducible, you would have to compare the digest of what you built with sha256:9a210bb9cbbdba5ae2199b659551959cd01e0299419f4118d111f8443971491a -- not the sha256:fb1a43b50c7047e5f28e309268a8f5425abc9cb852124f6828dcb0e4f859a4a1 that docker outputs, as shown in the article.<p>The tag used for this example (mcr.microsoft.com&#x2F;dotnet&#x2F;sdk:5.0-alpine) has since been updated. Comparing this with the original using container-diff just tells us that the size changed: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;jonjohnsonjr&#x2F;90c2def551833c8cacf3264248825855" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;jonjohnsonjr&#x2F;90c2def551833c8cacf3264...</a><p>But looking at the actual manifests, config blobs, and layers using crane is often faster and more interesting: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;jonjohnsonjr&#x2F;283eab27d996b2f4cc045530283b40be" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;jonjohnsonjr&#x2F;283eab27d996b2f4cc04553...</a><p>My intention with crane is to be easily composable so that you can use familiar tools like tar, sort, diff, jq, etc.<p>(To be fair to container-diff, you can use the -t flag to show similar things.)<p>I realize this is not really the point of the article, but it&#x27;s a huge pet peeve of mine that everyone has just given up on understanding what&#x27;s going on with their images because the tooling UX makes everything so opaque. If the digest of something doesn&#x27;t match, you should know why! It&#x27;s as if `git push --force` was on by default and everyone has just accepted that reality.<p>Now to read the rest of the article :)
评论 #26120197 未加载
评论 #26121075 未加载