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
Container Build: Add tar.gz (Docker Archive) file writing #35151
Conversation
src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/ArchiveFileRegistry.cs
Outdated
Show resolved
Hide resolved
I added a test leg to baronfel/sdk-container-demo for this, and you can see the results of the new job here. It looks like the archive file creation logic is clobbering or doesn't do correct permissions checks or something though? Here's the error I saw: https://github.com/baronfel/sdk-container-demo/actions/runs/6087233076/job/16515358596#step:4:31 |
I tweaked a bit the output path handling. I think the problem in your case was that you tried to create use a non-existing directory path in your test. Generally I rather thought that people should/will use a path down to a file so they know also the file name afterwards. The folder name was rather a fallback for use case where we wanna set a common property from global level (e.g. via msbuild property). I think this lead to an issue that we tried to write to a file which has a directory path. I added some further checks just for safety purposes. Here a sneak peek of the next upcoming PR on top of this. But I want to handle each topic and feature individually.
|
How should we treat repository names that contain slashes? Right now they create subdirectories, and I'm not sure if that's expected or not. |
The new package looks good to me: https://github.com/baronfel/sdk-container-demo/actions/runs/6098632737/job/16548885491 |
@Danielku15 this looks good to me, with two hopefully minor requests:
|
You should create a format string with placeholders for the two variables in the Strings.resx file and the build (build.cmd/sh) should create matching translation entries for the other languages automatically on your behalf. That should be the biggest portion :)
My thinking here was my use case - where I specify a folder. In that case the outputs wouldn't be directly known and would require that the user reconstruct them from the other inputs (path + repository name, etc) and it's just nicer to emit outputs from the target instead in these cases. This is the same reason we emitted the digest as an output, etc. |
@baronfel Updated the code in 0a820fe. Unfortunately I have to rely on runtime type checks to extract the output path from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks :)
Fixes dotnet/sdk-container-builds#283, dotnet/sdk-container-builds#431 (partially)
This PR introduces a new feature which allows developers to write tar.gz archives as understood by Docker (and podman) in a
docker load
operation.The effective changes are:
ILocalRegistry
like theRegistry
(representing the remote registry) and also providing a way to determine which kind of refernce we are having (similar to the OneOf generation in Protobuf).ILocalRegistry
implementation which dumps the tar.gz to disk (creating of these archives already exists from the DockerCli implementation)ArchiveOutputPath
which developers would point to the absolute path where they wanna have the archive written.DestinationImageReferenceKind
sTo be discussed and agreed:
ContainerBuilder
andCreateNewImage
workflows. Didn't like this duplication of code and workflow - DRY is a bit violated here and it also makes testing tricky.