Error loading shared library libstdc++.so.6: No such file or directory (needed by ./app)
Repro steps
My suspicion is that the project template web is not going to work by default for AOT. It should be webapiaot instead. The tests should be updated for this.
Create project:
docker run --name 8.0-create-web-133759161689369714 -w /app --platform linux/amd64 mcr.microsoft.com/dotnet/nightly/sdk:8.0-alpine3.20-aot-amd64 dotnet new web --framework net8.0 --no-restore --exclude-launch-settings
Dockerfile:
ARG sdk_image
ARG runtime_image
ARG runtime_deps_image
FROM $sdk_image AS build
ARG rid
ARG InternalAccessToken
ARG port
EXPOSE $port
WORKDIR /source
COPY NuGet.config .
WORKDIR /source/app
COPY app/*.csproj .
RUN dotnet restore -r $rid
COPY app/ .
RUN dotnet build --no-restore
FROM build AS publish
ARG rid
RUN dotnet publish -r $rid -c Release --self-contained true -o out
FROM $runtime_deps_image AS app
ARG port
EXPOSE $port
WORKDIR /app
COPY --from=publish /source/app/out ./
ENTRYPOINT ["./app"]
Error message
Repro steps
My suspicion is that the project template
web
is not going to work by default for AOT. It should bewebapiaot
instead. The tests should be updated for this.Create project:
Dockerfile:
Build image: