#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build WORKDIR /app EXPOSE 6669 COPY . . ENV ASPNETCORE_URLS http://+:6669 ENV TZ=Asia/Shanghai RUN ln -snf /usr/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone ENTRYPOINT ["dotnet", "WebApplication1.dll"]
容易抛异常的问题
Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'.
解决:
ENV ASPNETCORE_URLS http://+:6669
ENV ASPNETCORE_URLS =http://+:6669 //错误的格式,提示不支持