mcr.microsoft.com/dotnet/core/aspnet:2.1安装libgdiplus
#FROM registry-vpc.cn-shanghai.aliyuncs.com/shiningrise/aspnetcore-build:2 AS builder FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS builder ENV ASPNETCORE_ENVIRONMENT Production WORKDIR /source COPY . . RUN dotnet restore RUN dotnet publish --output /app/ --configuration Release SocialClass.WebApi FROM mcr.microsoft.com/dotnet/core/aspnet:2.1 AS runtime RUN echo "deb http://mirrors.aliyun.com/debian/ buster main contrib non-free \ deb http://mirrors.aliyun.com/debian/ buster-updates main contrib non-free \ deb http://mirrors.aliyun.com/debian/ buster-backports main contrib non-free \ deb http://mirrors.aliyun.com/debian-security buster/updates main contrib non-free \ " > /etc/apt/sources.list RUN set -ex && apt-get update -y && apt-get install -y libgdiplus locales fontconfig && apt-get clean && ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll WORKDIR /app/ COPY --from=builder /app . EXPOSE 5000 ENV WEIXIN_APPID 微信公众号ID ENV WEIXIN_APPSECRET 微信公众号密钥 COPY docker-entrypoint.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/docker-entrypoint.sh #RUN cat ~/.nuget/NuGet/NuGet.Config ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]