I am using docker desktop in my laptop and i am trying to map the volume as below so that Azure DevOps container agent will be ready. But due to some volume path error. I am getting following error. Please suggest. and you can see the respective files in the respective folder.
What is the version of your Docker Desktop and the Docker CE in it? Please, share the output of
docker version
not as a picture, but a text. Use code blocks surrounded by three backticks before and after like
```
output here
```
\\.\pipe\docker_engine is a named pipe, not a file. The error you are experiencing existed, but Docker supports mounting named pipes on Windows. You could use the long syntax
docker run ... --mount type=npipe,source=\\.\pipe\docker_engine,target=\\.\pipe\docker_engine ...
but my version recognizes it is an named pipe and sets the type automatically.
Docker Desktop 4.34.0 and Dcoker CE (Engine) 27.2.0
Regarding double backslashes, named pipes require that, but according to the documentation, bind mounting files doesn’t unless you work in Git Bash
PS C:\Users\LAPSAdmin> docker --version
Docker version 26.1.4, build 5650f9b
PS C:\Users\LAPSAdmin> cd I:\DockerLinuxAgent
PS I:\DockerLinuxAgent> ls
Directory: I:\DockerLinuxAgent
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 9/7/2024 3:46 PM 1881 Dockerfile
-a---- 9/7/2024 3:46 PM 2448 start.sh
and you can see the content in the respective path above, so what mistake I am doing below ? could you please correct, I tried again but still error coming up.
PS I:\DockerLinuxAgent> docker run -d -v I:\\DockerlinuxAgent:c\\agent\\work --name cagentsept8 --hostname cagent8 --restart unless-stopped -v \\.\pipel\docker_engine:\\.\pipe\docker_engine -e VSTS_AGENT_INPUT_TOKEN=pqwm5oonrmm5o57uvod4msgndaohczubqmg5hxbdr6ydjzpfc3qq -e VSTS_AGENT_INPUT_POOL=YOUR_POOL devops:agentv2
docker: Error response from daemon: \\.\pipel\docker_engine%!(EXTRA string=is not a valid Windows path).
See 'docker run --help'.
PS I:\DockerLinuxAgent>
Thank you for adding code blocks, however, you don’t have to put everything into code blocks so I fixed it for you know. I’m sure, next time you will do it correctly.
That is just the engine version.
But, even the engine version shows you are using at least a little bit older Desktop. Maybe there was a bug in that. I recommend updating the desktop to the latest v4.34.x
You got a totally different error. how is that the same? Jut remove the drive lettter from the destination. You don’t need that. If I remember correctly, you couldn’t mount a folder anywhere else than C and anything after the colon is the mode like “ro”, meaning read-donly. And "\agent\work` is not a mode.
And again, don’t put your own thoughts into code blocks, only the parts where you share anything with special characters which would be interpreted by the forum’s markdown filter. We will not recognize what you are saying and what is the part of the error message. At least not immediately. I fixed it again.