I got same problem when publish image for rhel runtime:
dotnet publish -r rhel.8-x64
problem was solved then I change runtime to linux:
dotnet publish -r linux-x64