1

If anyone can provide any help or suggestions with the following I'd be very grateful, I've tried to include the debugging steps I've already taken.

Issue: When attempting to run docker-compose up --build --scale cypress=3 --force-recreate from a Github Action step on a self-hosted runner, I get the following error:

error during connect: This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version": open //./pipe/docker_engine: Access is denied.

Code snippet:

name: Test build
on:
  workflow_dispatch:
  pull_request:
    types:
      - opened
      - synchronize
      - reopened
      - ready_for_review
    branches:
      - main
  push:
    branches:
      - main

jobs:
  build-and-run-tests:
    runs-on: [self-hosted, test]
    env:
      ASPNETCORE_ENVIRONMENT: 'Development'

    steps:       
      - name: Stop w3 service
        run: net stop w3svc
        continue-on-error: true

      - name: Checkout branch
        uses: actions/checkout@v3
        with:
          clean: false

      - name: Setup node
        uses: actions/setup-node@v2
        with:
          node-version: '16'

# Build and publish application steps...

      - name: Run Cypress Tests
        run: |
          cd $Env:GITHUB_WORKSPACE\Tests\
          & docker version
          & docker-compose up --build --scale cypress=3 --force-recreate  

Debugging steps taken:

  1. Running docker version on the step outputs the following which seems to suggest docker daemon is running:
Client:
Cloud integration: v1.0.28
Version:           20.10.17
API version:       1.41
Go version:        go1.17.11
Git commit:        100c701
Built:             Mon Jun  6 23:09:02 2022
OS/Arch:           windows/amd64
Context:           default
Experimental:      true
  1. I've run docker-compose up --build --scale cypress=3 --force-recreate whilst remoted onto the self-hosted running, the command is successful.
D Sayer
  • 73
  • 1
  • 9
  • Can you run a simple docker command like `docker run alpine`? – rethab Jul 29 '22 at 12:48
  • Similar situation, I can if I remote onto the self-hosted runner, but running it from the Github action is producing the error: `docker: error during connect: This error may indicate that the docker daemon is not running.: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/create": open //./pipe/docker_engine: Access is denied.` – D Sayer Jul 29 '22 at 12:52

2 Answers2

0

I've managed to find the answer to this in this question: Docker for Windows 10 //./pipe/docker_engine: access is denied.

Specifically, this answer: https://stackoverflow.com/a/40086454/19664211

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 04 '22 at 13:23
0

After many frustrating hours with much questionable language invoked, I just wanted to share what I did to make this work since the answer attached to this issue didn't completely do the trick for me (perhaps because my issue is slightly different).

I had to do two things to solve this issue on a Windows Server 2019 with GitHub Actions that call docker build with a Windows runner:

  1. As described in the post https://www.ibm.com/docs/en/addi/6.1.0?topic=prerequisites-configuring-docker-engine-listen-tcp-socket I added { "experimental":true, "hosts": ["tcp://0.0.0.0:2376","npipe://"] } to the daemon.json file.

  2. I added a environment variable at the system level: DOCKER_HOST=tcp://localhost:2376

  3. Add a new rule to the firewall for the TCP port

Kate
  • 102
  • 5