A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/app/'.

Open
#3,935 19 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp, docker, google-cloud
Domain
backend, cloud, devops

Research direction

Begin with the supplied multi-stage Dockerfile and the reproduction repository, then reproduce the image startup in Google Cloud Run. Trace why the published application cannot find libhostpolicy.so and verify the resulting deployment configuration by confirming that the sample starts without the fatal error.

Written by the indexing model from the issue text.

Description

Hi,
I am getting the following error when deploying donet core 3.0 with docker:
A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/app/'.

This is my Dockerfile:
`
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
WORKDIR /app
EXPOSE 8080

FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /src
COPY ["TestCloudRun.csproj", "TestCloudRun/"]
RUN dotnet restore "TestCloudRun/TestCloudRun.csproj"
COPY . .
WORKDIR "/src/TestCloudRun"
RUN dotnet build "TestCloudRun.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "TestCloudRun.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "TestCloudRun.dll"]
`
This is the repo: https://github.com/avifatal/core3deployment-issue

I should mention that I'm deploying to google cloud run.

Thanks

Dominant language
C#
Stars
3.2k
Forks
1.3k
Avg merge
4d 1h
Merged PRs (30d)
235

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/sdk

All issues in dotnet/sdk

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.