Hello,
I am trying to follow this link to build and create container images in ACR.
https://microsoftlearning.github.io/deploy-and-manage-containers-with-azure-kubernetes-service/Instructions/Labs/Exercise_02_build_linux_windows_container_images.html
Note: I am trying to execute commands from AZ CLI using VS Code terminal on my machines instead of Azure Cloud Shell.
az acr build --registry $env:ACR_NAME --image hellofromdotnet:v1.0 --platform windows --file Dockerfile.windows .
Did managed to build a linux image and push to ACR.
However, when I try to build and push a windows container image it fails on
line:
RUN dotnet publish -c release -o /app
with
error message:
Step 5/11 : RUN dotnet publish -c release -o /app
---> Running in dc36f30782ba
Determining projects to restore...
C:\Program Files\dotnet\sdk\8.0.401\NuGet.targets(174,5): error : Access to the path 'C:\source\dotnetcore-docs-hello-world\obj\dotnetcoresample.csproj.nuget.g.props' is denied. [C:\source\dotnetcore-docs-hello-world\dotnetcoresample.csproj]
The command 'cmd /S /C dotnet publish -c release -o /app' returned a non-zero code: 1
2024/09/07 00:11:55 Container failed during run: build. No retries remaining.
failed to run step ID: build: exit status 1
Run ID: cr9 failed after 2m3s. Error: failed during run, err: exit status 1
Run failed