Skip to content

Fix docker integration code to compile and run.#482

Merged
IEvangelist merged 3 commits intomicrosoft:mainfrom
alistairmatthews:fix-docker-integration-code
Feb 26, 2026
Merged

Fix docker integration code to compile and run.#482
IEvangelist merged 3 commits intomicrosoft:mainfrom
alistairmatthews:fix-docker-integration-code

Conversation

@alistairmatthews
Copy link
Contributor

Previous to this PR, the article suggested that the method is called like this:

var cache = builder.AddRedis("cache")
                   .PublishAsDockerComposeService();

This won't compile or run because you need to pass an action:

var apiService = builder.AddProject<Projects.AspireDockerExp_ApiService>("apiservice")
    .PublishAsDockerComposeService((resource, service) => 
      { 
        service.Name = "redis"; 
      });

Plus a couple of other fixes.

Copilot AI review requested due to automatic review settings February 26, 2026 12:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes critical compilation issues in the Docker integration documentation by correcting the PublishAsDockerComposeService API usage and fixing the AddParameterFromConfiguration API signature. The previous documentation showed these methods being called without required parameters, which would prevent the code from compiling.

Changes:

  • Updated PublishAsDockerComposeService calls to include the required action callback (resource, service) => { } throughout all code examples
  • Fixed AddParameterFromConfiguration calls to include both the required name and configurationKey parameters
  • Added pragma warning directives to suppress experimental API warnings for container image push options and container registry APIs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@IEvangelist IEvangelist enabled auto-merge (squash) February 26, 2026 14:44
@IEvangelist
Copy link
Member

Had to fix those styles, they were triggering me. 😬

@IEvangelist IEvangelist merged commit 35f52c6 into microsoft:main Feb 26, 2026
6 checks passed
@alistairmatthews alistairmatthews deleted the fix-docker-integration-code branch February 26, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants