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.
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
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...
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) ?
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 ?
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...
but I still would like to run docker as a service, instead of login as my local user to launch it with its GUI
You could try to create a task scheduler to run docker with that specific user when your PC starts.
Please check this thread How to create an automated task using Task Scheduler on Windows 10 for some more details.
In this case, docker will start automatically every time you start your computer.
Related
I have created a container via Docker Desktop on a Windows PC and would now like to start this container like a service or daemon during system startup. If successful, the container would be accessible from its own network via 192.168.178.35:80 without a user having to log in and start Docker.
This is really not my favorite topic but I tried to learn about Windows task scheduling.
As you can see here I wrote a short powershell script that starts Docker Desktop.exe and then the container.
start "C:\Program Files\Docker\Docker\Docker Desktop.exe"
sleep 10
docker start 9df2014cdb06
exit
I assigned the script to the SYSTEM user in the task scheduler. (see screenshot 1)
Unfortunately, 192.168.178.35:80 cannot be reached when the system is booted. When I log in, I see that various Docker background processes in Task manager. (See screenshot 2).
However, Docker is no longer accessible in Powershell. (See error message)
PS C:\WINDOWS\system32> docker ps
error during connect: In the default daemon configuration on Windows, the docker client must be
run with elevated privileges to connect.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json":
open //./pipe/docker_engine: The system cannot find the file specified.
And starting it from the desktop icon does not succeed either. Instead, the message appears that Docker is already running.
But my container is not running.
How do I get my container running and accessible on Windows after system startup and before user login?
I've updated Docker Desktop from 4.6.1 to 4.11.1, but after that I can't start Docker Desktop nor docker service. I looked in the logs and found this message:
[2022-08-12T19:27:53.379639400Z][com.docker.backend.exe][F] fork/exec C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe: This program is blocked by group policy. For more information, contact your system administrator.
I see the error is provoked by a policy that the company where I work at has on every computer and it's something I can't change, so my question is:
Is there any way to configure Docker to start using CMD instead of Powershell? Or do I have to reinstall previous version and avoid updating?
I created a task to autostart docker on windows server using TaskScheduler
referred to https://stackoverflow.com/a/59467740/12768108
As admin created a local "task-executor" user and added it to the administrator group.
As admin added the same user to the docker-users group
Now after logging into the system using another user account(already in the docker users group), I run the task manually from the task scheduler the docker services started with daemon mode and I am able to run all docker commands like "docker ps".
But when restarting the machine it only started two services of docker ie "docker desktop" and "docker desktop backend" and not others, also when tried to run docker ps gives below error
error during connect: This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json": open //./pipe/docker_engine: The system cannot find the file specified.
I have also tried https://github.com/tfenster/dockeraccesshelper but this helps me achieve only point 1 of the description.
Can someone please let me know what i am missing here ?
As a part of regression testing need to run the bash script on windows machine which actually open the chrome browser and traverse the website and generate the test report.
when i try to execute it through jenkins all the test cases are getting failed as its unable to open the browser, the same is getting passed when we logon to the remote windows server and execute the script manually.
NOTE: Have provided the same credentials on jenkins slave windows service
found below log on event manager
Activation of app Microsoft.Windows.Cortana_cw5n1h2txyewy!CortanaUI failed with error: This app can't be activated by the Built-in Administrator. See the Microsoft-Windows-TWinUI/Operational log for additional information.
Could you please help me here..
Hi can you enable the option Allow service to interact with desktop for the jenkins slave service on your windows slave machine.
You can enable it by going In services.msc > right click on service name > Properties > Log On > Allow service to interact with desktop
i'm facing a problem with VSTS agent state is offline i installed the agent through cmd under the right pool and downloaded after that but it still offline any help please ?
If the build agent is running as interactive mode, you need to start agent by running run.cmd file:
Open Command line as administrator
Run run.cmd file (under agent folder)
If the build agent is running as service, you can check whether the related service is running in Services.