带有 ASP.NET Core 库的 Docker 容器 [英] Docker container with ASP.NET Core libraries

查看:33
本文介绍了带有 ASP.NET Core 库的 Docker 容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我使用 ASP.NET Core 应用程序构建 Dockerfile 时,它​​都会从网络 Nuget 商店下载程序集.

Each time I build Dockerfile with ASP.NET Core application it's download assemblies from web Nuget store.

基本上我想用所有这些 ASP.NET Core 库(可能还有一些我经常使用的库)来创建 docker 镜像.

Basically I'd like to create docker image with all this ASP.NET Core libraries (and probably some libraries I usually use).

据我所知,我试图重塑 GAC.

From my understanding I trying to reinvent GAC.

那么,我的问题是可以将 GAC 之类的东西用于 ASP.NET Core 吗?或者,我的第二个想法是,将 ASP.NET Core 库下载到容器中,然后以某种方式在本地解析它.

So, my question is it possible to use something like GAC for ASP.NET Core? Or, my second thought, download ASP.NET Core libraries to container and then resolve it locally somehow.

我的目标是减少构建 docker 容器的时间.

My goal is to reduse time for building docker container.

更新

看起来不可能

推荐答案

现在有一个来自 Microsoft 的官方 .NET Core Docker 映像,其中包含所有需要的库.

There is now an official .NET Core Docker image from Microsoft, with all the needed libraries.

你可以在这里得到它:

https://hub.docker.com/r/microsoft/aspnetcore/

如果你需要自定义,别忘了你可以修改容器并使用docker commit"创建自定义镜像.

If you need to customize it, don't forget you can modify the container and create a custom image with "docker commit".

这篇关于带有 ASP.NET Core 库的 Docker 容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆