asp.net core使用docker部署到linux
asp.net core使用docker部署到linux
asp.net core是net技术框架的趋势,他可以部署在windows的iis上也可以部署在linux上,这里是通过docker部署到linux并运行
前期准备
- visual studio 2019;
- centos7;
- xshell以及xftp
- linux 服务器上安装docker
创建简单项目
使用visual studio 2019创建asp.net core 3.1的简单项目

创建Dockerfile
#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/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["aspnetcoretest/aspnetcoretest.csproj", "aspnetcoretest/"]
RUN dotnet restore "aspnetcoretest/aspnetcoret

本文介绍了如何使用asp.net core 3.1创建项目,并通过Docker将其部署到Linux服务器。内容包括前期准备(如安装visual studio 2019,centos7,xshell/xftp及Linux上的docker),创建Dockerfile,生成镜像,以及运行实例的详细步骤。
1683

被折叠的 条评论
为什么被折叠?



