【问题标题】:Docker image does not get updated after changing Route and rebuilding the ASP.NET Core Api controller更改 Route 并重建 ASP.NET Core Api 控制器后,Docker 映像未更新
【发布时间】:2020-08-31 06:34:29
【问题描述】:

通常当我更新 api 控制器代码时。我使用批处理文件重建项目..

================================================ ============================ rd bin /s /q

rd obj /s /q

dotnet build -c Release -o bin/Release/netcoreapp2.2/publish -r linux-x64

dotnet publish -c Release -o bin/Release/netcoreapp2.2/publish -r linux-x64 --self-contained false

docker build -t efcoreservice.azurecr.io/efcoreservice .

================================================ =============================== 当我运行容器时,它没有反映我所做的代码更改。我多次遇到这个问题。我添加了 rd 命令以确保清理输出文件夹。它没有帮助。

临时解决方法是强制删除本地计算机中的所有图像并重新构建。 我应该怎么做才能更新 docker 镜像 - 当底层项目发生变化时。

我使用 docker-compose up 和 down 命令来调出图像。

【问题讨论】:

    标签: image docker


    【解决方案1】:

    如果图像已经存在,up 命令永远不会重建。使用docker-compose build 强制他们重建。

    https://github.com/docker/compose/issues/1487

    【讨论】:

      猜你喜欢
      • 2016-10-13
      • 1970-01-01
      • 1970-01-01
      • 2020-12-20
      • 1970-01-01
      • 2021-12-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多