An Azure service that provides a general-purpose, serverless container platform.
Hi Ian,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
The error "Selected tag uses an invalid operating system" doesn't mean your Dockerfile is invalid. In fact, your Dockerfile is perfectly fine for a standard Linux container. The issue lies in the hidden metadata generated by modern Docker build tools and how Azure Container Apps parses it.
The Root Cause
If you are using a recent version of Docker Desktop, it uses Docker Buildx as the default build engine. Starting from Buildx v0.10, Docker automatically attaches SLSA provenance attestations (build metadata) to your image when you push it.
These attestations are packaged as part of a multi-part OCI manifest list, and the "operating system" metadata for the attestation itself is marked as unknown/unknown. When Azure Container Apps tries to pull the image by its tag, it encounters this attestation manifest first, fails to read a valid operating system, and throws the exact error you are seeing: Selected tag uses an invalid operating system ''.
Additionally, if you are building this locally on an Apple Silicon Mac (M1/M2/M3), Docker builds the image for ARM64 by default, which Azure Container Apps (expecting linux/amd64) will also reject.
The Solution
You can fix this by explicitly disabling the provenance attestation and enforcing the correct architecture when you run your docker build command.
Run the following command in the directory with your Dockerfile:
Bash
docker buildx build --platform linux/amd64 --provenance=false -t <your-acr-name>.azurecr.io/<your-image-name>:<new-tag> --push .
What this command does:
-
--provenance=false: Stops Docker from attaching the "unknown" attestation metadata, so Azure Container Apps will read the pure container manifest directly. -
--platform linux/amd64: Ensures the image is compiled for standard x86-64 servers, which is the underlying architecture Azure Container Apps relies on. -
--push: Pushes it directly to your ACR in one step.
Note: Be sure to replace the bracketed placeholders with your actual ACR details. I highly recommend using a new tag (like v2) so Azure doesn't rely on cached, broken metadata from the old tag.
Deploy the Container App using the new tag, and it should run successfully. Let me know in comments if still facing issue.
Note: This response is drafted with the help of AI systems.