Hi, I am working on my exam project however I came across an issue that I wasn’t able to solve. So I have a C# backend that I want to build with docker and make a test environment however I am receiving an error that I can create a folder. Does anyone know how to fix this? Thank you in advance.
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
FROM base AS final
COPY /app/publish .
ENTRYPOINT [“dotnet”, “Api.dll”]
Jenkinsfile part that fails
echo “We are building”
sh “dotnet build --configuration Release”
sh “sudo dotnet publish -c Release -o /app/publish”
sh “docker-compose --env-file config/Test.env build api”
Error message: Unable to create directory “/app/publish/”. Access to the path ‘/app/publish/’ is denied.