I'm trying to configure a GoCD agent to build my projects using Docker. Originally my GoAgents ran as SYSTEM, because that is the default install on Windows, but I found that created problems during the build (I was getting weird failures due to $env:TEMP not being defined or being defined in a weird place).
I switched my go agents to a local account and granted account rights to run as a service. This worked well until I tried to build docker images. I have a script that works perfectly as my user but fails when running as the GoCD agent.
error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.32/build?buildargs=%7B%22EngineDir%22%3A%22C%3A%5C%5CInfinity%22%2C%22ImageVersion%22%3A%222.0.0%22%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&session=29985a28e57e1f1b4fa8950cfa0f747b4c2680fa5f4fcb3643f68b4595825651&shmsize=0&t=invoke-infinity%3Alatest&t=invoke-infinity%3A2.0.0&target=&ulimits=null: open //./pipe/docker_engine: Access is denied. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
I've tried adding the user to docker-users group but that doesn't appear to help. I've tried following this article http://dille.name/blog/2017/11/29/using-the-docker-named-pipe-as-a-non-admin-for-windowscontainers/ but get and error saying Docker Windows doesn't support "hosts".
Does anybody have any way for a non-admin user on Windows to run docker build?
Thanks
This has now been fixed in Docker for Windows version 18.03.0-ce. Basically this version creates a local group called docker-users, who all have access to the pipe. Simply add the desired users as members of that group, happy days!