Skip to content

aspire deploy requires docker to be running, but azd up doesn't #11408

Open

Description

When aspire deploy runs and needs to publish a .NET project via a container, it fails if Docker Desktop isn't running.

Image

However, when I azd up the same app, it doesn't require Docker Desktop to be running.

Looking into azd's code, it looks like they tell the dotnet publish command to push to the server:

https://github.com/Azure/azure-dev/blob/1213533c4673df47eaeaaf5133751eb62eba0518/cli/azd/pkg/tools/dotnet/dotnet.go#L182-L190

	runArgs = runArgs.AppendParams(
		"-r", "linux-x64",
		"-c", configuration,
		"/t:PublishContainer",
		fmt.Sprintf("-p:ContainerRepository=%s", imageParts[0]),
		fmt.Sprintf("-p:ContainerImageTag=%s", imageParts[1]),
		fmt.Sprintf("-p:ContainerRegistry=%s", server),
		"--getProperty:GeneratedContainerConfiguration",
	)

However, in aspire deploy we are doing it in 2 steps (step 1 and 3 below):

https://github.com/dotnet/aspire/blob/d82f17385e51b6aebb5170e2ddb023c74e52f987/src/Aspire.Hosting.Azure/AzureDeployingContext.cs#L152-L183

We should see if we can remove this requirement for Docker Desktop to be running during aspire deploy.

cc Safia Abdalla (@captainsafia) Victor Vazquez (@vhvb1989)

Activity

  1. added
    needs-area-label
    on Sep 15, 2025
  2. added
    azure
    and removed
    needs-area-label
    on Sep 15, 2025
  3. davidfowl commented on Sep 15, 2025

    @davidfowl
    Collaborator

    Today we're doing the image push with docker outside of msbuild.

  4. captainsafia commented on Sep 15, 2025

    @captainsafia
    Contributor

    Today we're doing the image push with docker outside of msbuild.

    Correct.

    I have mixed thoughts about taking advantage of the push functionality in dotnet publish to do this. I like the idea of modeling tag/push as distinct steps, instead of overloading the "build image" step with functionality that also does the remote push.

  5. eerhardt commented on Sep 15, 2025

    @eerhardt
    MemberAuthor

    cc Chet Husk (@baronfel) if he has opinions on whether we should use dotnet publish's capability of pushing to the remote registry or not.

    In general, it isn't horrible that I need Docker Desktop running to do aspire deploy, but it is a paper cut.

  6. baronfel commented on Sep 15, 2025

    @baronfel
    Member

    I mean, of course I'm going to say you should use our stuff.

    Having said that, what you could do is probe for docker first fallback to the SDK if it's not around and you're publishing .NET projects.

  7. added this to the 13.0 milestone on Oct 16, 2025
  8. davidfowl commented on Oct 16, 2025

    @davidfowl
    Collaborator

    I think we should do this and have a way to opt into (via IConfiguration) using the container runtime to push images. I think it means breaking up into much smaller steps as well since today everything is happening in a single step.

  9. captainsafia commented on Oct 17, 2025

    @captainsafia
    Contributor

    I think it means breaking up into much smaller steps as well since today everything is happening in a single step.

    What od you mean by this? Our steps are currently more granular than azd's because we split up build and tag+push.

    Using dotnet publish to push would make it less granular unless there is a way to call dotnet publish twice (once to build and once to push).

  10. davidfowl commented on Oct 17, 2025

    @davidfowl
    Collaborator

    I think of it like a mini pipeline per project instead of grouping functionality for all compute resources.

    These steps would run concurrently.

    project0 = step-project0-build-and-push
    container0 = step-container0-build -> step-container0-push

  11. baronfel commented on Oct 17, 2025

    @baronfel
    Member

    unless there is a way to call dotnet publish twice (once to build and once to push).

    I do have a PR that separates the logical steps involved so that everything is much more incremental (in the MSBuild sense). It should be very possible to enable separate explicit build commands for those steps based on those primitives if y'all really need that. That PR is kinda parked right now due to a bunch of 10 GA work, but if we need to put actual engineers on it to close it out for y'all we should talk to Marc Paine (@marcpopMSFT) about prioritization.

  12. captainsafia commented on Oct 17, 2025

    @captainsafia
    Contributor

    I think of it like a mini pipeline per project instead of grouping functionality for all compute resources.

    These steps would run concurrently.

    project0 = step-project0-build-and-push container0 = step-container0-build -> step-container0-push

    Ah, I see. I think this is unrelatd to this docker issue since it impacts other scenarios as well, like more granular deployments for compute environments as well.

    For image builds, we can probably remove the parallelism from the ResourceContainerImageBuilder and update the implementation to emit pipeline steps itself instead of executing the logic.

    I also realized we're a little inconsistent in our API shapes for that class. BuildImage takes multiple resources as arguments but not the other two (ref).

    I do have a PR that separates the logical steps involved so that everything is much more incremental (in the MSBuild sense). It should be very possible to enable separate explicit build commands for those steps based on those primitives if y'all really need that.

    It's not blocking at the moment especially since we rely on the container runtime API above to do the tag + push separate from build which I think works better with a more granular pipeline.

    I have mixed thoughts about taking advantage of the push functionality in dotnet publish to do this. I like the idea of modeling tag/push as distinct steps, instead of overloading the "build image" step with functionality that also does the remote push.

  13. davidfowl commented on Oct 17, 2025

    @davidfowl
    Collaborator

    I see it like delegating to the resource instead of having an outer orchestra or drive. Ifs not inconsistent, its inversion of control.

  14. davidfowl commented on Nov 1, 2025

    @davidfowl
    Collaborator

    Turns out we need this until we support a build and push which means containers don't end up in the local docker registry.

  15. maddymontaquila commented on May 14, 2026

    @maddymontaquila
    Collaborator

    This has been addressed/resolved in #13576. Closing as done. Thank you for filing! If you're still experiencing issues with the latest version, please open a new issue.

  16. davidfowl commented on May 14, 2026

    @davidfowl
    Collaborator

    Reopening after reviewing the recent bulk closure. The close comment appears to cite work that does not fully address this issue, so this should remain open for normal triage.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-deploymentazure

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions