Windows Container之.NET Core找不到gdiplus.dll解決方案

Windows Container之.NET Core找不到gdiplus.dll解決方案

同事回報,有一支 API 轉移至 Windows Container 之後,特定 Action 會產生 HTTP 500 錯誤,查詢容器日誌快速定位到問題:

fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HLHTEASOTJDP", Request id "0HLHTEASOTJDP:00000002": An unhandled exception was thrown by the application.
System.TypeInitializationException: The type initializer for 'ClosedXML.Excel.XLHelper' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'gdiplus.dll': The specified module could not be found.
   at System.Runtime.InteropServices.FunctionWrapper`1.get_Delegate()
   at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output)
   at System.Drawing.SafeNativeMethods.Gdip..cctor()
   --- End of inner exception stack trace ---
   at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromScan0(Int32 width, Int32 height, Int32 stride, Int32 format, HandleRef scan0, IntPtr& bitmap)
   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
   at ClosedXML.Excel.XLHelper..cctor()
   --- End of inner exception stack trace ---

無法刪除的Container STATUS - Removal In Progress

無法刪除的 Container STATUS - Removal In Progress

同事回報,在執行重新部署後,Container 出現一個未見過的狀態:Removal In Progress,會造成後續持續部署失敗:

案例1:

Removal In Progress

案例2:

Removal In Progress 2

追追追:快爆炸99%伺服器記憶體用到哪裡去了?

追追追:快爆炸99%伺服器記憶體用到哪裡去了?

Memory 使用 99%

公司有台 Disk I/O 與 Network I/O 量不小的 Server Core - Docker Host 伺服器,發現 Momery 被使用至 99%,雖然看起來(似乎)不影響 Container App 的運作,執行 Docker CLI 或 PowerShell 非常明顯的反應遲鈍鈍鈍,直覺不查不行。

完成Docker EE for Windows在Swarm最後一哩Routing mesh(Ingress Mode)

完成 Docker EE for Windows 在 Swarm 最後一哩 Routing mesh(Ingress Mode)

在 Docker Enterprise Edition for Windows Server (簡稱 Docker EE for Windows) 架設與使用 Swarm Mode 時,一定會碰到一個問題,就是目前 Docker EE for Windows 還不支援 Swarm Mode 裡重要的 Routing mesh(又稱 Ingress mode) 功能。

在 Microsoft Docs 文件並沒有把話寫死,它寫著 "coming soon",讓我心裡一直有個希望的種子。

routing-mesh-coming-soon

釐清多 Windows Container 針對同一 Volume 運作時的權限身份

釐清多 Windows Container 針對同一 Volume 運作時的權限身份

專案有個需求,會同時有多個 Windows Container 對 Docker Host 同一資料夾進行操作,讀取、新增、刪除、修改都有,而且操作的量不小(秒級)。問題出在,A Container 建立資料夾與檔案,B Container 要操作時會出現 Access Denied。找了好久原因,終於釐清整個 Windows Container 在 Volume 運作時的身份與權限。

簡化的情境如下:

Docker Host --> A Container / B Container