Pipeline is returning Docker not found error

I have the following gitlab-ci.yml … (details removed)

    stages:
     - build
     - dev
     - test_dev
    
    before_script:
      - docker info
      - echo $CI_CONFIG_PATH
      - echo $CI_PROJECT_NAME
    
    Build:
      stage: build
      services: 
       - name: docker:20.10.7-dind
      script:
       - docker build -t mywidgets:0.1 .
      tags:
        - docker-azure
    
    dev_deployment: 
      stage: dev
      script:
        - docker run --rm -d --name deployPlatform mywidgets:0.1 bash -c "tail -f /dev/null"
        - docker exec deployPlatform pwsh -c "./opt/source-code/deploy-azure-function.ps1"
        - docker exec deployPlatform pwsh -c "cat ./opt/source-code/src/local.settings.json"
        - docker stop deployPlatform
      tags:
        - docker-azure
    
    Postman_Tests_Dev: 
      stage: test_dev
      services: 
        - name: docker:20.10.7-dind
      image:
        name: postman/newman
        entrypoint: [""]
      script:
        - docker run --rm -d --name postmanTester -v postman_tests:/etc/newman postman/newman newman --version
        - docker cp ./postman_tests/devtests.json postmanTester:/etc/newman/devtests.json
      tags:
        - docker-azure

What’s Not Working

My pipeline gets to the post_tests_dev section and dies with the following errors:

    ....................................................................................++++
    2021-06-08T20:15:34.135380000Z e is 65537 (0x010001)
    2021-06-08T20:15:34.157786800Z Signature ok
    2021-06-08T20:15:34.157809500Z subject=CN = docker:dind client
    2021-06-08T20:15:34.158073000Z Getting CA Private Key
    2021-06-08T20:15:34.169808500Z /certs/client/cert.pem: OK
    2021-06-08T20:15:35.383259900Z time="2021-06-08T20:15:35.382940100Z" level=info msg="Starting up"
    2021-06-08T20:15:35.384950300Z time="2021-06-08T20:15:35.384634900Z" level=warning msg="could not change group /var/run/docker.sock to docker: group docker not found"
    2021-06-08T20:15:35.384973400Z failed to load listeners: can't create unix socket /var/run/docker.sock: device or resource busy
    *********
    Pulling docker image postman/newman ...
    Using docker image sha256:0d827bc1e7e4c1539ede9a4802b0845f1c2d555e4a3a07d84c64e9ddc8909866 for postman/newman with digest postman/newman@sha256:ea4d3d71bebd1e1e4a845481de38c5316e02df09a35d0291bfa850f0ea6b3c0e ...
    Preparing environment
    00:11
    Running on runner-upzg1uag-project-4513-concurrent-0 via admins-Macllocal...
    Getting source from Git repository
    00:10
    Fetching changes with git depth set to 50...
    Reinitialized existing Git repository in /builds/jj/playground/.git/
    Checking out 7d4469aa as master...
    Skipping Git submodules setup
    Executing "step_script" stage of the job script
    00:11
    /bin/sh: eval: line 111: docker: not found
    $ docker info
    Cleaning up file based variables
    00:10
    ERROR: Job failed: exit code 127

I googled the error “failed to load listeners: can’t create unix socket /var/run/docker.sock: device or resource busy” and found this article: Docker in Docker Service (DIND) broken on 11.11 runner (#4260) · Issues · GitLab.org / gitlab-runner · GitLab

It seems to be related to a setting in my config.toml for my runner.

My config.toml looks like this:

    [[runners]]
      name = "widgetrunner"
      url = "https://ourgitlabserver/"
      token = "upzG1uaG-dqz2auYoxjR"
      executor = "docker"
      [runners.custom_build_dir]
      [runners.cache]
        [runners.cache.s3]
        [runners.cache.gcs]
        [runners.cache.azure]
      [runners.docker]
        tls_verify = false
        image = "docker:stable"
        privileged = true
        disable_entrypoint_overwrite = false
        oom_kill_disable = false
        disable_cache = false
        volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
        shm_size = 0

I had to add:

       volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]

in order to get the build of my widget image to work…

What I’ve Tried

I’ve also tried to change the name of the service i use for the postman_test_dev section from

  services: 
    - name: docker:20.10.7-dind

to

  services: 
    - name: docker:latest

But I get the same error.

It’s not clear to me how fix this. Still trying to make my way through that article to see if I can make heads or tails out of it.
Any tips would be appreciated.

figured it out. dont’ need to use “docker run”. I just need to run the newman commands in the script section.