Im working with Microsoft Dynamics 365 Business Central. (ERP Software).
Im attempting to create build agents on my local server to set up Continious Integration with my projects.
On the buildserver i am running Docker Enterprise on Windows 2019.
When i spin up my dockeragent to facilitate the builds im experiencing an issue.
The dockeragent is asked by my CI flow to spin up another docker container called navcontainerhelper which is basically a docker container that contains the Business Central environment to build my application on.
However the navcontainerhelper doesnt know the docker commands since it doesnt include docker.
Ive researched and found that mounting the docker socket with -v is the way to do this however i cant seem to get that working.
When i create the agent i am using the following command:
docker run -v /var/run/docker.sock:/var/run/docker.sock -ti dockeragent:latest -e AZP_URL=<My azure url> -e AZP_TOKEN=<my azure token) -e AZP_AGENT_NAME=<my builder agent name>
when i attempt to execute this i get the following command which leads me to the mentioned conclusion.
docker : C:\Program Files\docker\docker.exe: Error response from daemon: invalid volume specification: '/var/run/docker.sock:/var/run/docker.sock'.
At C:\dockeragent\StartAgents.ps1:1 char:1
+ docker run -v /var/run/docker.sock:/var/run/docker.sock -ti dockerage ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (C:\Program File...n/docker.sock'.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
See 'C:\Program Files\docker\docker.exe run --help'.
Could someone give me a pointer as to what i am doing wrong?
I have changed the script to use the named pipes instead for windows. it now mounts like this:
docker run -e AZP_URL=<My azure url> -e AZP_TOKEN=<my azure token) -e AZP_AGENT_NAME=<my builder agent name> -v \\.\pipe\docker_engine:\\.\pipe\docker_engine dockeragent:latest
However the container still refuses to recognize my docker command:
New-NavContainer : The term 'docker' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\azp\agent\_work\***\s\scripts\Create-Container.ps***:36 char:***
+ New-NavContainer @parameters `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (docker:String) [New-NavContainer], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,New-NavContainer
PowerShell exited with code '***'.
Any pointers would be greatly appreciated!