OSX - Gitlab-runner "error during connect: Get http://docker:2375/v1.40/containers/json: dial tcp: lookup docker on 192.168.65.1:53: no such host""

I'm having trouble when trying to run a .gitlab-ci.yml job locally:

I've tried suggestions from similar issues: #1592 (closed) and #6295 (closed) but couldn't manage to make it work.

.gitlab-ci.yml

test:
  image: docker:git
  script:
    - docker ps

docker --version

Docker version 19.03.8, build afacb8b

When running:

docker run \
    --rm \
    -it \
    -v $PWD:$PWD \
    -v /var/run/docker.sock:/var/run/docker.sock \
    --workdir $PWD gitlab/gitlab-runner exec docker test;
Running with gitlab-runner 12.9.0 (4c96e5ad)
...
$ docker ps
error during connect: Get http://docker:2375/v1.40/containers/json: dial tcp: lookup docker on 192.168.65.1:53: no such host