FROM mcr.microsoft.com/dotnet/sdk:7.0 AS base ARG ARCH=x64 COPY ./* /src/ WORKDIR /src/ RUN dotnet restore --runtime linux-${ARCH} RUN dotnet publish \ --runtime linux-${ARCH} \ --no-self-contained \ --no-restore \ --configuration Release \ --output /demo FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi:latest ENV DOTNET_VERSION=7.0 \ PATH=/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ LD_LIBRARY_PATH=/usr/lib64:/lib64:/usr/lib:/lib \ DOTNET_RUNNING_IN_CONTAINER=true RUN dnf upgrade -y --nodocs --setopt install_weak_deps=0 && \ INSTALL_PKGS="aspnetcore-runtime-${DOTNET_VERSION} openssl" && \ dnf install -y --nodocs ${INSTALL_PKGS} COPY --from=base /demo /demo #ENV LD_DEBUG=all WORKDIR /demo ENTRYPOINT ["dotnet", "demo.dll"]