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

Support explicitly specifying an image by SHA digest, not just tag #448

Closed
baronfel opened this issue May 26, 2023 · 7 comments · Fixed by dotnet/sdk#44461
Closed

Support explicitly specifying an image by SHA digest, not just tag #448

baronfel opened this issue May 26, 2023 · 7 comments · Fixed by dotnet/sdk#44461

Comments

@baronfel
Copy link
Member

Currently users cannot specify a ContainerBaseImage just by SHA digest. This means there is no real workaround for cases when our inference can't decipher a manifest list, or when an image doesn't provide individually-tagged OS/arch variants. We should unblock this and let users specify a digest. When a digest is specified we would skip right to blob download of the manifest json instead of pulling the tag config in order to find that same manifest. Every other part of image building should remain the same from that point onwards.

@BeyondEvil
Copy link

It really bothers me that 1) this isn't already supported as it's a best practice for production images to use SHA and 2) that this only has two thumbs up (one is mine). 😱

We have a workaround. Basically a oneliner that creates a base image based on the SHA, but this really should be supported.

@baronfel
Copy link
Member Author

As you mentioned, this hasn't been especially requested either by the community or our internal users (who prefer the 'float to latest' approach of the tooling today). I'd definitely love to take a PR implementing this feature, though!

@BeyondEvil
Copy link

As you mentioned, this hasn't been especially requested either by the community or our internal users (who prefer the 'float to latest' approach of the tooling today).

ooof, that makes me 😬

But maybe they don't use this in production? 🤷‍♂

I'd definitely love to take a PR implementing this feature, though!

Where would I add that PR, seeing how this repo only seems to be documentation 😅

@baronfel
Copy link
Member Author

The code for all of this is in the .NET SDK - though the MSBuild logic is in a subdirectory.

I think the core thing missing to enable this is around the parsing and validation that happens in the ParseContainerProperties Task.

I think we are already capable of recognizing the digest syntax for an image - but we need to provide that information to the rest of the Tasks, making it an Output of the ParseContainerProperties Task and making the CreateNewImage task take it as an input.

@BeyondEvil
Copy link

The code for all of this is in the .NET SDK - though the MSBuild logic is in a subdirectory.

I think the core thing missing to enable this is around the parsing and validation that happens in the ParseContainerProperties Task.

I think we are already capable of recognizing the digest syntax for an image - but we need to provide that information to the rest of the Tasks, making it an Output of the ParseContainerProperties Task and making the CreateNewImage task take it as an input.

Yeah, the SHA is prefixed with @, so if not already fixed it should be trivial to add it.

@BeyondEvil
Copy link

BeyondEvil commented Oct 26, 2024

It's a start @baronfel

dotnet/sdk#44461

But I'm going to need guidance. I'm not a dotnet:er.

@scrocquesel-ml150
Copy link

Hi, I upvote this issue too. Having a floating to latest doesn't allow for a repeatable predictive CI process we had with dockerfile.
I also want to be able to use dependabot/renovate tools to automatically update the base image digest and keep my container image up-to-date without using complex solution or having to build my app every night just in case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants