Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ The command performs the following steps to deploy an app orchestrated with Aspi
- Starts the AppHost and its resources.
- Executes the `deploy` pipeline step, and any dependent steps, registered in the app model.

### Local container image builds

When your deployment pipeline containerizes a .NET project, the .NET container build step builds the image locally on the machine running `aspire deploy`, before the image is pushed to a registry or deployed to the target environment.

:::caution[Match the container OS]
When the build uses your local container runtime, its OS mode must match the OS of the image configured for the resource in your AppHost: Linux containers for Linux images, or Windows containers for Windows images. This is the container runtime's mode, not necessarily your host operating system.

On Windows, if your AppHost targets Linux images, select **Switch to Linux containers** from the Docker Desktop menu before running `aspire deploy`. Leaving Docker Desktop in Windows containers mode can cause the local image build to fail, even when the deployment target runs Linux.
:::

## Pipeline summary output

After the pipeline finishes, `aspire deploy` prints a result summary and a step-by-step breakdown. The summary shows how many steps succeeded, the total pipeline duration, and a `Steps Summary:` table.
Expand Down
24 changes: 24 additions & 0 deletions src/frontend/tests/unit/cli-container-builds.vitest.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { readFileSync } from 'node:fs';
import { describe, expect, test } from 'vitest';

const source = readFileSync(
new URL('../../src/content/docs/reference/cli/commands/aspire-deploy.mdx', import.meta.url),
'utf8',
);

describe('CLI deployment container prerequisites', () => {
test('explains that .NET container images are built locally before deployment', () => {
expect(source).toMatch(/\.NET container build step[^.\n]*locally[^.\n]*`aspire deploy`/);
});

test('warns about matching the container runtime OS and switching Docker Desktop mode', () => {
const caution = source.match(/:::caution\[Match the container OS\]\n([\s\S]*?)\n:::/)?.[1];

expect(caution).toBeDefined();
expect(caution).toMatch(/OS mode must match[^.\n]*AppHost/);
expect(caution).toContain('Linux containers for Linux images');
expect(caution).toContain('Windows containers for Windows images');
expect(caution).toContain('Docker Desktop');
expect(caution).toContain('Switch to Linux containers');
});
});