.net - 我可以合并这两个 docker 图像吗?
问题描述
我是 docker 新手,所以这可能是实现这一目标的错误方法。
当我在 Visual Studio 中创建一个新的 .net 项目并说我希望它在 docker 上运行时,它会创建这个 docker 文件。
#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/containercompat
FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-1803 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM microsoft/dotnet:2.1-sdk-nanoserver-1803 AS build
WORKDIR /src
COPY ["WebApplication1/WebApplication1.csproj", "WebApplication1/"]
RUN dotnet restore "WebApplication1/WebApplication1.csproj"
COPY . .
WORKDIR "/src/WebApplication1"
RUN dotnet build "WebApplication1.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "WebApplication1.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "WebApplication1.dll"]
我想在我的应用程序中使用 Azure 表存储,它已经创建了这个图像
microsoft/azure-storage-emulator 作为 tableStorage
我可以添加吗
FROM microsoft/azure-storage-emulator as tableStorage
在同一个 Dockerfile 中并以某种方式在同一个连续图像上使用表存储模拟器?显然他们似乎在组合一堆图像,但我不知道如何组合表格存储图像。
谢谢。
解决方案
推荐阅读
- apache-camel - 使用石英触发器 + dnsActivationPolicy 的骆驼路线问题
- python - 我正在尝试制作一个虚拟助手,但我不断收到错误消息:“builtins.NameError: name 'r' is not defined”,即使我定义了 r
- python - 如何在python中将数组数据映射到CSV文件?
- javascript - me.dom 在 ExtJS 中的组合框动画事件上为空
- html - 错误的 Flexbox 大小
- swiftui - UINavigation 在 SwiftUI 中的横向模式下中断
- amazon-web-services - 查找其他人实例的 EC2 实例 ID
- snort - snort 规则来检测 Ssl 证书
- python - 使用 cogs discord.py 说出坏话时出错
- java - jar 文件会被视为工件吗?