sdk-container-builds icon indicating copy to clipboard operation
sdk-container-builds copied to clipboard

Request to add option to disable default pushing to remote registry when specifying ContainerRegistry

Open vyruz1986 opened this issue 1 year ago • 4 comments

When adding the ContainerRegistry property to a project, and specifying a remote registry, it seems the default behaviour is that the built image will also be immediately pushed to that remote registry. While this is exactly what I want in a build pipeline environment, I would like to request an option to disable this when building locally.

Often times I find myself running the dotnet publish command locally, to debug a specific image build, these builds should not be published to the remote registry.

I would suggest adding a parameter like PushToRemoteRegistry with a default value of true, so that we can turn this off in our project configs and then pass /p:PushToRemoteRegistry=true in our build pipelines.

The work around I am using now is to not specify ContainerRegistry at all, then in my build pipeline add some docker tag test-image:1.2.3 myregistry.azurecr.io/test-image:1.2.3 commands followed by a docker push myregistry.azurecr.io/test-image:1.2.3 command.

vyruz1986 avatar Sep 25 '23 13:09 vyruz1986