Unable to load shared library 'ldap.so.2' #168
Replies: 1 comment
-
Hi. FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base RUN apt-get update COPY ["ActiveDirectoryWindowsAuth/SSL", "/usr/local/share/ca-certificates"] FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build FROM build AS publish FROM base AS final WORKDIR /app |
Beta Was this translation helpful? Give feedback.
-
Hi.
I'm trying to run a .NET 5 WebApi that uses ldap4net in a Docker container that is running standard ASP.NET 5 runtime image.
However ldap is not found, even after installing it and copying files to /usr/lib.
Any ideas?
My Dockerfile:
`FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env
WORKDIR /app
WORKDIR /src
COPY . ./
RUN dotnet restore "Appetite.csproj" -s "https://api.nuget.org/v3/index.json"
WORKDIR "/src/Appetite"
RUN dotnet publish -c Debug -o /app/out
FROM mcr.microsoft.com/dotnet/aspnet:5.0
WORKDIR /app
RUN apt-get update
&& apt-get install -y --no-install-recommends libldap-2.4-2
&& apt-get install -y --no-install-recommends libldap-common
&& rm -rf /var/lib/apt/lists/*
RUN ln -s /usr/lib/x86_64-linux-gnu/libldap-2.4.so.2.11.5 /usr/lib/libldap.so.2
RUN ln -s /usr/lib/x86_64-linux-gnu/liblber_r-2.4.so.2.11.5 /usr/lib/liblber.so.2
COPY --from=build-env /app/out .
EXPOSE 5000
EXPOSE 5001
ENTRYPOINT ["dotnet", "Appetite.dll"]`
Beta Was this translation helpful? Give feedback.
All reactions