asp.net core docker 部署

1.添加Dockfile文件

#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:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

COPY . .

ENTRYPOINT ["dotnet", "MvcMovie.dll"]

2.制作镜像

docker build -t mvcmovie .

3.运行镜像

docker run --name mvcmovie -p 6666:80 -d mvcmovie:latest

posted @ 2023-08-02 17:56  赏花赏月赏秋香  阅读(24)  评论(0编辑  收藏  举报