docker 为镜像打名字_已发布好的.NET Core项目文件如何打包为Docker镜像文件

问题描述

在博文(【Azure App Service For Container】创建ASP.NET Core Blazor项目并打包为Linux镜像发布到Azure应用服务)中我们通过VS 2019可以为项目添加Dockerfile并自动生成Docker Image文件。但是如果不借助于VS2019我们如何来操作呢?

解决步骤

准备Dockerfile

进入项目文件夹中,创建Dockerfile并COPY以下内容:

71416eefedd634f509903acddce2dd57.png

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompatFROM mcr.microsoft.com/dotnet/aspnet:5.0 AS baseFROM mcr.microsoft.com/dotnet
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值