Building Projects and Containers
The Build command will build all projects defined in the aspire manifest file, and push the containers to the registry (if specified), or the local docker daemon.
The command is extremely useful for rebuilding and pushing containers to the registry using a simple menu to select the items you want to build.
The command will first create the manifest file, however, this can be overridden if you pass in the path to an existing manifest file using the --aspire-manifest
or -m
flag and supplying the path.
By default project container images are built using dotnet publish -t:PublishContainer
. When --prefer-dockerfile
switch is specified, Aspir8 will use custom Dockerfile
if available for a project. It will search for Dockerfile
in same directory .csproj
is located, or use DockerfileFile
from csproj. DockerfileContext
msbuild property is respected, but can be overridden for all projects by specifying --container-build-context
.
Example
Cli Options (Optional)
Option | Alias | Environmental Variable Counterpart | Description |
---|---|---|---|
--project-path | -p |
| The path to the aspire project. |
--aspire-manifest | -m |
| The aspire manifest file to use |
--container-image-tag | -ct |
| The Container Image Tag to use as the fall-back value for all containers. |
--container-registry | -cr |
| The Container Registry to use as the fall-back value for all containers. |
--container-repository-prefix |
| The Container Repository Prefix to use as the fall-back value for all containers. | |
--container-builder |
| The Container Builder: can be | |
--non-interactive |
| Disables interactive mode for the command | |
--disable-secrets |
| Disables secrets management features. | |
--runtime-identifier |
| Sets the runtime identifier for project builds. Defaults to | |
--compose-build | Can be included one or more times to set certain dockerfile resource building to be handled by the compose file. This will skip build and push in aspirate. | ||
--launch-profile | -lp |
| The launch profile to use when building the Aspire Manifest. |
--prefer-dockerfile |
| Instructs to use Dockerfile when available to build project images. | |
--container-build-context | -cbc |
| The Container Build Context to use when Dockerfile is used to build projects. |
--container-build-arg | -cba |
| The Container Build Arguments to use for all projects with custom Dockerfile. In |