简体   繁体   English

在自托管 windows azure devops 代理上运行 docker 容器的权限

[英]Permissions to run docker container on self-hosted windows azure devops agent

In an azure devops build pipeline running on a self-hosted windows agent, I am trying to execute a tool that run a docker container.在自托管 windows 代理上运行的 azure devops 构建管道中,我正在尝试执行一个运行 docker 容器的工具。 Unfortunately I get this error:不幸的是,我收到了这个错误:

Failed to start: failed to create container: Error response from daemon: CreateFile c:\Users\BUILDAGENT\.aerokube\selenoid: Access is denied.

The build agent is configured with its own windows local user "BUILDAGENT", so he has permissions on the C:\Users\BUILDAGENT\ folder构建代理配置了自己的 windows 本地用户“BUILDAGENT”,因此他对C:\Users\BUILDAGENT\文件夹具有权限

Looking at the process manager, I see that except com.docker.service, the others docker processes are running with the user that launched the Docker Desktop (my coworker). Looking at the process manager, I see that except com.docker.service, the others docker processes are running with the user that launched the Docker Desktop (my coworker). If I restart windows and relaunch docker myself, the settings selected by my coworker ("Disk Image Location" for instance), are not restored...如果我自己重新启动 windows 并重新启动 docker,我的同事选择的设置(例如“磁盘映像位置”)不会恢复...

Is there a way to make docker run as a daemon on startup with a specific user (service or system user, but not mine or my coworker)?有没有办法让 docker 在启动时与特定用户(服务或系统用户,但不是我的或我的同事)一起作为守护程序运行? Once this is done I guess I just have to give permissions for that specific user on the C:\Users\BUILDAGENT\ folder to solve my issue, right?完成此操作后,我想我只需要在 C:\Users\BUILDAGENT\ 文件夹上为该特定用户授予权限即可解决我的问题,对吗?

Update:更新:

I added my BUILDAGENT user in docker-users group, and it solves the permission issue, but I still would like to run docker as a service, instead of login as my local user to launch it with its GUI...我在 docker-users 组中添加了我的 BUILDAGENT 用户,它解决了权限问题,但我仍然想将 docker 作为服务运行,而不是作为本地用户登录以使用其 GUI 启动它...

but I still would like to run docker as a service, instead of login as my local user to launch it with its GUI但我仍然想将 docker 作为服务运行,而不是以我的本地用户身份登录以使用其 GUI 启动它

You could try to create a task scheduler to run docker with that specific user when your PC starts.您可以尝试创建一个任务计划程序,以便在您的 PC 启动时与该特定用户一起运行 docker。

Please check this thread How to create an automated task using Task Scheduler on Windows 10 for some more details.请查看此线程如何使用 Windows 10 上的任务计划程序创建自动化任务以获取更多详细信息。

In this case, docker will start automatically every time you start your computer.在这种情况下,docker 将在您每次启动计算机时自动启动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Azure DevOps Windows托管的生成代理中运行Linux容器 - Run Linux containers in an Azure DevOps Windows hosted build agent 使用自托管证书签署Windows可执行文件 - Signing Windows Executables with self-hosted certificate Matlab, Windows compatible Docker Container Fails to run Matlab job steps of Azure Devops CI/CD job - Matlab, Windows compatible Docker Container Fails to run Matlab job steps of Azure Devops CI/CD job 在Windows中运行Docker容器 - Run a docker container into Windows 通过Internet访问Azure虚拟机上的自托管WCF服务 - Access to a self-hosted WCF service on azure virtual machine over the Internet 如何在自托管 GitHub Actions runner 上运行前/后作业脚本 - How to run pre/post job scripts on self-hosted GitHub Actions runner 没有管理权限的localhost上的自托管REST API - Self-hosted REST API on localhost without administrative privileges WCF自托管:匿名身份验证方案禁止使用HTTP请求 - WCF self-hosted: http request forbidden for authentication scheme anonymous 我可以运行在Docker容器中的IIS上托管的dotnet应用程序吗? - Can I Run a dotnet app which is hosted on IIS in a docker container? 无法在 windows 服务器 2019 中运行 docker 容器 - Cannot run docker container in windows server 2019
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM