問題描述
在不同的用戶下啟動 docker 容器 (Start the docker container under a different user)
我們需要從運行 dotnetcore api 的 docker 容器訪問活動目錄(文件共享)中的共享資源。Api 以 (dotnet api.dll
) 開頭。docker contrainer 中的當前用戶是 ContainerAdministrator
。
我們使用的是 Windows 2016 server
參考解法
方法 1:
Finally made it work. Added a powershell script that run "net use" first and the dotnet command after.
Use cmd in the docker file to start the ps script.
Thanks for the answers
方法 2:
You need to setup Windows based authentication infrastructure first. It's not simple DockerFile change. Details are here in series of blog articles both for .NET core and full .NET framework. https://artisticcheese.wordpress.com/2017/09/09/enabling‑integrated‑windows‑authentication‑in‑windows‑docker‑container/
(by hippie、hippie、Gregory Suvalian)