asp.core生成docker镜像(使用本地nuget)

生成Dockerfile

vs自带生成Dockerfile功能了
image
image
image

使用本地的nuget包

  1. 加入nuget配置文件NuGet.Config
  2. NuGet.Config配置文件,配置地址
    image
    image
    如果没有配置生成镜像会报错,没找到package
    image

生成镜像

image
image
生成Docker映像(想深入了解,可以网上看看docker build的参数)
docker build -f "C:\Project\Apollo\Apollo.TaobaoOpenCrm\src\Apollo.TaobaoOpenCrm.Host\Dockerfile" --force-rm -t apollotaobaoopencrmhost --label "com.microsoft.created-by=visual-studio" --label "com.microsoft.visual-studio.project-name=Apollo.TaobaoOpenCrm.Host" "C:\Project\Apollo\Apollo.TaobaoOpenCrm"

生产发布(jenkins生成镜像)

生成的Dockerfile一般都是放在,启动项目里面的。运维会要求你Dockerfile放在根目录。
image
image

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章