#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base #### SQLSERVER TLS 版本问题#### RUN sed -i 's/TLSv1.2/TLSv1/g' /etc/ssl/openssl.cnf RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf #### SQLSERVER TLS 版本问题#### WORKDIR /app ####### Begin Https 证书问题######## ENV ASPNETCORE_Kestrel__Certificates__Default__Password="123456" ENV ASPNETCORE_Kestrel__Certificates__Default__Path=/app/server.pfx ENV certPassword 123456 RUN openssl genrsa -des3 -passout pass:${certPassword} -out server.key 2048 RUN openssl rsa -passin pass:${certPassword} -in server.key -out server.key RUN openssl req -sha256 -new -key server.key -out server.csr -subj '/CN=localhost' RUN openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt RUN openssl pkcs12 -export -out server.pfx -inkey server.key -in server.crt -certfile server.crt -passout pass:${certPassword} ####### END Https 证书问题####### EXPOSE 80 EXPOSE 443 FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build WORKDIR /src COPY ["src/DARSA.ABP.Web.Host/DARSA.ABP.Web.Host.csproj", "src/DARSA.ABP.Web.Host/"] COPY ["src/DARSA.ABP.Web.Core/DARSA.ABP.Web.Core.csproj", "src/DARSA.ABP.Web.Core/"] COPY ["src/DARSA.ABP.Application/DARSA.ABP.Application.csproj", "src/DARSA.ABP.Application/"] COPY ["src/DARSA.ABP.Core/DARSA.ABP.Core.csproj", "src/DARSA.ABP.Core/"] COPY ["src/DARSA.ABP.EntityFrameworkCore/DARSA.ABP.EntityFrameworkCore.csproj", "src/DARSA.ABP.EntityFrameworkCore/"] RUN dotnet restore "src/DARSA.ABP.Web.Host/DARSA.ABP.Web.Host.csproj" COPY . . WORKDIR "/src/src/DARSA.ABP.Web.Host" RUN dotnet build "DARSA.ABP.Web.Host.csproj" -c Release -o /app/build FROM build AS publish RUN dotnet publish "DARSA.ABP.Web.Host.csproj" -c Release -o /app/publish /p:UseAppHost=false FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "DARSA.ABP.Web.Host.dll"]
标签:DARSA,ABP,Web,src,ubunt,server,abp,RUN,docker From: https://www.cnblogs.com/valeb/p/17730464.html