Unable to create directory

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.

Dockerfile:
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM base AS final
WORKDIR /app
COPY /app/publish .
ENTRYPOINT [“dotnet”, “Api.dll”]

Jenkinsfile part that fails
steps {
echo “We are building”
dir(“Api”){
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.