在不同的用戶下啟動 docker 容器 (Start the docker container under a different user)


問題描述

在不同的用戶下啟動 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 hippiehippieGregory Suvalian)

參考文件

  1. Start the docker container under a different user (CC BY‑SA 2.5/3.0/4.0)

#docker-desktop #docker #docker-for-windows #dockerfile






相關問題

在 Docker 容器中安裝 Windows 服務 (Install Windows service in Docker container)

在不同的用戶下啟動 docker 容器 (Start the docker container under a different user)

如何在 Docker Desktop 上創建新的 Kubernetes 集群? (How to create a new Kubernetes cluster on Docker Desktop?)

連接期間的 Docker for Desktop 錯誤:發布連接嘗試失敗,因為連接方沒有正確 (Docker for Desktop error during connect: Post A connection attempt failed because the connected party did not properly)

Jenkins 昨天安裝成功並在 windows 10 的 docker 桌面上運行,但今天無法在 http://localhost:8080 啟動 jenkins (Jenkins installed successfully and run on docker desktop on windows 10 yesterday , but unable to start jenkins at http://localhost:8080 today)

運行“docker exec”時發布端口 (publish port when running 'docker exec')

無法連接到 docker-desktop kubernetes 中部署的 API?負載均衡器服務不工作 (Unable to connect to the API deployed in docker-desktop kubernetes?. Loadbalancer service not working)

我在哪裡可以看到失敗的 Docker Desktop Windows 安裝的日誌文件? (Where can I see log files for failed Docker Desktop Windows installation?)

如何從 docker-credential-osxkeychain 獲取價值 (How to get value from docker-credential-osxkeychain)

無法訪問 Kubernetes 集群外的 NodePort 服務 (Cannot access NodePort service outside Kubernetes cluster)

如何在 eclipse-che 環境中配置 docker 引擎 (How to configure docker engine inside eclipse-che environment)

如何在 Docker Desktop 中使用參數運行 docker 實例? (How to run a docker instance with params in Docker Desktop?)







留言討論