dotnet / sdk-container-builds

Libraries and build tooling to create container images from .NET projects using MSBuild
https://learn.microsoft.com/en-us/dotnet/core/docker/publish-as-container
MIT License
175 stars 30 forks source link

Add option to specify registry url from cli #550

Closed atrakic closed 4 months ago

atrakic commented 4 months ago

After authentication to ACR, there should be a option to push to ACR without editing Cproj properties. Otherwise, please provide documentation how to create and use custom profile dotnet publish -p:PublishProfile=MyAcr.

dviry commented 4 months ago

Have you tried using /p:ContainerRegistry=xxx ? Seems to work fine for me...

baronfel commented 4 months ago

Publish Profiles are just collections of properties, so if you'd like to use a custom Profile you can set any project properties that you like. You can see some examples of custom Publish Profiles (and how to use them) in my demos repo here: https://github.com/baronfel/sdk-container-demo/tree/main/src/sdk-container-demo/Properties/PublishProfiles