{"record":{"id":"cc004bbbd55457e0","repo":"microsoft/aspire","slug":"container-image-imagereference-does-not-contain-a-linux","errorCode":null,"errorMessage":"Container image '{imageReference}' does not contain a linux/amd64 manifest with an immutable digest.","messagePattern":"Container image '(.+?)' does not contain a linux/amd64 manifest with an immutable digest\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Azure.Sandboxes/AzureSandboxContainerDeployment.cs","lineNumber":1023,"sourceCode":"        ArgumentNullException.ThrowIfNull(runtime);\n        ArgumentException.ThrowIfNullOrWhiteSpace(imageReference);\n\n        var result = await runtime.InspectImageManifestAsync(imageReference, cancellationToken).ConfigureAwait(false);\n        if (result.Status == ContainerImageInspectionStatus.Unsupported)\n        {\n            throw new NotSupportedException(\n                $\"Container runtime '{runtime.Name}' does not support image manifest inspection, which is required for Azure sandbox deployment.\");\n        }\n\n        if (result.Status == ContainerImageInspectionStatus.Failed)\n        {\n            throw new InvalidOperationException(\n                result.ErrorMessage ?? $\"Container runtime failed to inspect image manifest '{imageReference}'.\");\n        }\n\n        if (!result.TryGetManifest(\"linux\", \"amd64\", out var manifest))\n        {\n            throw new InvalidOperationException(\n                $\"Container image '{imageReference}' does not contain a linux/amd64 manifest with an immutable digest.\");\n        }\n\n        return CreateDigestImageReference(imageReference, manifest.Digest);\n    }\n\n    private static string CreateDigestImageReference(string imageReference, string digest)\n    {\n        var digestSeparator = imageReference.IndexOf('@');\n        if (digestSeparator >= 0)\n        {\n            return $\"{imageReference[..digestSeparator]}@{digest}\";\n        }\n\n        var lastSlash = imageReference.LastIndexOf('/');\n        var lastColon = imageReference.LastIndexOf(':');\n        var repository = lastColon > lastSlash ? imageReference[..lastColon] : imageReference;\n","sourceCodeStart":1005,"sourceCodeEnd":1041,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Azure.Sandboxes/AzureSandboxContainerDeployment.cs#L1005-L1041","documentation":"Sandbox deployment requires an immutable linux/amd64 manifest digest. After inspection succeeds, TryGetManifest(\"linux\", \"amd64\") is used to find that manifest; if the image has no linux/amd64 entry in its manifest list, deployment cannot proceed and throws InvalidOperationException.","triggerScenarios":"Inspecting an image whose multi-arch manifest list lacks a linux/amd64 platform entry (e.g. an arm64-only or windows-only image), or inspecting a single-platform image where the runtime did not expose the expected platform manifest.","commonSituations":"Using an arm64-only image on the deployment pipeline; building/pushing an image for the wrong platform; images built with --platform windows/amd64 for Windows containers being deployed to Linux sandboxes.","solutions":["Build or select a multi-arch image that includes linux/amd64: docker buildx build --platform linux/amd64 and push it.","Choose a different base image that publishes linux/amd64 manifests.","Verify the image's platforms with `docker manifest inspect <image>` and confirm a linux/amd64 entry exists.","If the local runtime hides the platform entry, pre-pull with `--platform linux/amd64` and retry."],"exampleFix":"// before\nARG base=mcr.microsoft.com/dotnet/runtime:10.0-noble-arm64v8\n\n// after\nARG base=mcr.microsoft.com/dotnet/runtime:10.0-noble\n# and build/push with:\n# docker buildx build --platform linux/amd64 -t myregistry.azurecr.io/myapp:latest --push .","handlingStrategy":"validation","validationCode":"var json = await GetManifestJsonAsync(\"docker\", $\"manifest inspect {image}\");\nusing var doc = JsonDocument.Parse(json);\nbool hasAmd64 = doc.RootElement.TryGetProperty(\"manifests\", out var ms) &&\n    ms.EnumerateArray().Any(m =>\n        m.TryGetProperty(\"platform\", out var p) &&\n        p.TryGetProperty(\"architecture\", out var a) && a.GetString() == \"amd64\" &&\n        p.TryGetProperty(\"os\", out var o) && o.GetString() == \"linux\");\nif (!hasAmd64) throw new InvalidOperationException($\"{image} lacks linux/amd64 manifest.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build and push with --platform linux/amd64 (or multi-arch) for sandbox targets.","Inspect manifest platforms with `docker manifest inspect` before deploying.","Avoid arm64-only or windows-only base images for sandbox deployments."],"tags":["containers","image","architecture","amd64","sandbox"],"backgroundTag":"unsupported-platform","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}