Radius.Compute/containerImages@2025-08-01-preview
❗️ Preview Release: This documentation covers a preview of Radius which uses different Resource Types from the current release. Enable it by passing the --preview to the Radius CLI or settingRADIUS_PREVIEW=true.
Description
The Radius.Compute/containerImages Resource Type builds a container image from source and pushes it to an OCI registry. Builds run inside the Radius control plane.
To use a containerImages resource in your application, add a containerImages resource to the application definition Bicep file, then reference the containerImages.imageReference property in the containers resource. For example:
extension radius
param environment string
resource myApp 'Radius.Core/applications@2025-08-01-preview' = {
name: 'myApp'
properties: {
environment: environment
}
}
resource myImage 'Radius.Compute/containerImages@2025-08-01-preview' = {
name: 'myImage'
properties: {
environment: environment
application: myApp.id
tag: 'v1.2.3'
build: {
source: 'git::https://github.com/myorg/myapp.git//frontend?ref=v1.2.3'
}
}
}
resource myContainer 'Radius.Compute/containers@2025-08-01-preview' = {
name: 'myContainer'
properties: {
environment: environment
application: myApp.id
containers: {
app: {
image: myImage.properties.imageReference
ports: {
web: {
containerPort: 3000
}
}
}
}
}
}
Multi-architecture builds (e.g. platforms: ["linux/amd64", "linux/arm64"]) require a Dockerfile that supports cross-compilation via FROM --platform=$BUILDPLATFORM and TARGETARCH. Dockerfiles that execute target-arch binaries during the build will fail with exec format error. There is no QEMU/binfmt fallback in this design.
Top-Level Properties
| Property | Type | Description |
|---|---|---|
application | string | (Required) The Radius Application ID. myApplication.id for example. |
build | object | (Required) Build configuration for the container image. |
codeReference | string | Optional URI to the source code of this resource type. ex: https://github.com/radius-project/radius/blob/4fab87e8127adf1db6f43b7029d5235fbe82c5c9/cmd/controller/main.go#L27 |
connections | object | Map of connection name to connection data. |
environment | string | (Required) The Radius Environment ID. Typically set by the rad CLI. Typical value should be environment. |
imageReference | string | (Read Only) The full image reference produced by the recipe in the form <registry>/<resource-name>:<tag>. Reference this from Radius.Compute/containers to consume the built image. |
tag | string | (Optional) Tag for the produced image. When omitted, the recipe computes a deterministic tag (sha256-<hash>) from the build inputs. A present tag must be a valid non-empty string. For git sources, pin to a commit SHA or immutable tag (e.g. ?ref=<sha>); with a moving ref like ?ref=main, the computed tag does not change when the upstream branch advances even though a later build can replace the content behind that tag. |
Object Properties
build
| Property | Type | Description |
|---|---|---|
args | object | (Optional) Map of --build-arg values passed to the build, e.g. { VERSION: 'v1.2.3' }. Argument names must match [A-Za-z_][A-Za-z0-9_]*. Values must not contain shell metacharacters. |
dockerfile | string | (Optional) Path to the Dockerfile relative to the build source. Defaults to Dockerfile. |
platforms | string array | (Optional) Target platforms to build for (e.g. ["linux/amd64"], ["linux/amd64", "linux/arm64"]). When omitted, defaults to ["linux/amd64", "linux/arm64"]. Multi-platform builds use cross-compilation; the Dockerfile must use FROM --platform=$BUILDPLATFORM and TARGETARCH. |
source | string | (Required) Source location for the build. Use a git URL of the form git::https://..., which BuildKit clones inside the cluster, or an operator-managed local directory. Radius does not upload workstation source. The default Bicep Recipe accepts local sources only beneath /var/radius/build-contexts and rejects symbolic links. The stock Radius Helm chart does not mount this directory; platform engineers using local sources must add a read-only mount by customizing or post-rendering the dynamic-rp Deployment. Git sources require no mount. The Terraform Recipe retains its existing local-path behavior. For git URLs, select a subdirectory with //<subdir> and a ref with ?ref=<branch-or-sha>, in that order. Example: git::https://github.com/myorg/myapp.git//frontend?ref=v1.2.3. |
connections
| Property | Type | Description |
|---|---|---|
disableDefaultEnvVars | boolean | Disables the automatic injection of environment variables from the connected resource’s properties. |
source | string | Resource ID of the source resource for this connection. |
Feedback
Was this page helpful?
Glad to hear it! Please feel free to star our repo and join our Discord server to stay up to date with the project.
Sorry to hear that. If you would like to also contribute a suggestion visit and tell us how we can improve.