Add AdditionalArguments property to ContainerBuildOptions for BuildKit cache configuration #13566
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Enables passing arbitrary arguments to
docker buildx buildandpodman buildcommands via a newAdditionalArgumentsproperty. This allows users to configure BuildKit cache backends (--cache-from,--cache-to) and other advanced features not exposed by existing properties.API Changes
ContainerBuildOptionsCallbackContext.AdditionalArguments(List<string>, initialized to empty list)ContainerImageBuildOptions.AdditionalArguments(List<string>?)Usage
Testing
Checklist
<remarks />and<code />elements on your triple slash comments?Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
westus2.data.mcr.microsoft.com/usr/share/dotnet/dotnet dotnet publish /home/REDACTED/work/aspire/aspire/tests/testproject/TestProject.ServiceA/TestProject.ServiceA.csproj --configuration Release /t:PublishContainer /p:ContainerRepository=servicea /p:ContainerImageTag=latest /p:RuntimeIdentifier=linux-x64 /p:ContainerRuntimeIdentifier=linux-x64 k/aspire/aspire/--exclude-standard grep -l ldOptions ng/PackageVersionProvider.cs /home/REDACTED/.cargo/bin/grep ldOptions s ndor/bin/grep grep(dns block)/usr/share/dotnet/dotnet dotnet publish /home/REDACTED/work/aspire/aspire/tests/testproject/TestProject.ServiceA/TestProject.ServiceA.csproj --configuration Release /t:PublishContainer /p:ContainerRepository=servicea /p:ContainerImageTag=latest /p:ContainerArchiveOutputPath=/tmp/test-output /p:ContainerImageFormat=OCI /p:RuntimeIdentifier=linux-x64 /p:ContainerRuntimeIdentifier=linux-x64 -l ldOptions ng/Lifecycle/IDistributedApplicationLifecycleHook.cs grep ldOptions cs /home/REDACTED/.ca. /tmp/MSBuildTempQVNV7J/tmp130a2ac8db0f4fac8baf7265292a271f.exec.cmd grep(dns block)/usr/bin/buildkitd buildkitd --allow-insecure-entitlement=network.host nfig/composer/ve--exclude-standard grep -l ldOptions ng/PackageVersionProvider.cs k/aspire/aspire/.dotnet//grep ldOptions s ep grep -l ldOptions ng/IDistributedApplicationBuilder.cs ndor/bin/grep ldOptions ions.cs k/aspire/aspire/--version grep(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.